master
Showing 4000 of 4113 lines.
1#***************************************************************************
2# _ _ ____ _
3# Project ___| | | | _ \| |
4# / __| | | | |_) | |
5# | (__| |_| | _ <| |___
6# \___|\___/|_| \_\_____|
7#
8# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
9#
10# This software is licensed as described in the file COPYING, which
11# you should have received as part of this distribution. The terms
12# are also available at https://curl.se/docs/copyright.html.
13#
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.
17#
18# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19# KIND, either express or implied.
20#
21# SPDX-License-Identifier: curl
22#
23#***************************************************************************
25dnl File version for 'aclocal' use. Keep it a single number.
26dnl serial 73
29dnl CURL_INCLUDES_FCNTL
30dnl -------------------------------------------------
31dnl Set up variable with list of headers that must be
32dnl included when fcntl.h is to be included.
34AC_DEFUN([CURL_INCLUDES_FCNTL], [
35curl_includes_fcntl="\
36/* includes start */
37#ifdef HAVE_SYS_TYPES_H
38# include <sys/types.h>
39#endif
40#ifdef HAVE_UNISTD_H
41# include <unistd.h>
42#endif
43#ifdef HAVE_FCNTL_H
44# include <fcntl.h>
45#endif
46/* includes end */"
47 AC_CHECK_HEADERS(
48 sys/types.h unistd.h fcntl.h,
49 [], [], [$curl_includes_fcntl])
50])
53dnl CURL_INCLUDES_IFADDRS
54dnl -------------------------------------------------
55dnl Set up variable with list of headers that must be
56dnl included when ifaddrs.h is to be included.
58AC_DEFUN([CURL_INCLUDES_IFADDRS], [
59curl_includes_ifaddrs="\
60/* includes start */
61#ifdef HAVE_SYS_TYPES_H
62# include <sys/types.h>
63#endif
64#ifndef _WIN32
65# include <sys/socket.h>
66#endif
67#ifdef HAVE_NETINET_IN_H
68# include <netinet/in.h>
69#endif
70#ifdef HAVE_IFADDRS_H
71# include <ifaddrs.h>
72#endif
73/* includes end */"
74 AC_CHECK_HEADERS(
75 sys/types.h netinet/in.h ifaddrs.h,
76 [], [], [$curl_includes_ifaddrs])
77])
80dnl CURL_INCLUDES_LIBGEN
81dnl -------------------------------------------------
82dnl Set up variable with list of headers that must be
83dnl included when libgen.h is to be included.
85AC_DEFUN([CURL_INCLUDES_LIBGEN], [
86curl_includes_libgen="\
87/* includes start */
88#ifdef HAVE_SYS_TYPES_H
89# include <sys/types.h>
90#endif
91#ifdef HAVE_LIBGEN_H
92# include <libgen.h>
93#endif
94/* includes end */"
95 AC_CHECK_HEADERS(
96 sys/types.h libgen.h,
97 [], [], [$curl_includes_libgen])
98])
101dnl CURL_INCLUDES_NETDB
102dnl -------------------------------------------------
103dnl Set up variable with list of headers that must be
104dnl included when netdb.h is to be included.
106AC_DEFUN([CURL_INCLUDES_NETDB], [
107curl_includes_netdb="\
108/* includes start */
109#ifdef HAVE_SYS_TYPES_H
110# include <sys/types.h>
111#endif
112#ifdef HAVE_NETDB_H
113# include <netdb.h>
114#endif
115/* includes end */"
116 AC_CHECK_HEADERS(
117 sys/types.h netdb.h,
118 [], [], [$curl_includes_netdb])
119])
122dnl CURL_INCLUDES_SETJMP
123dnl -------------------------------------------------
124dnl Set up variable with list of headers that must be
125dnl included when setjmp.h is to be included.
127AC_DEFUN([CURL_INCLUDES_SETJMP], [
128curl_includes_setjmp="\
129/* includes start */
130#ifdef HAVE_SYS_TYPES_H
131# include <sys/types.h>
132#endif
133#include <setjmp.h>
134/* includes end */"
135 AC_CHECK_HEADERS(
136 sys/types.h,
137 [], [], [$curl_includes_setjmp])
138])
141dnl CURL_INCLUDES_SIGNAL
142dnl -------------------------------------------------
143dnl Set up variable with list of headers that must be
144dnl included when signal.h is to be included.
146AC_DEFUN([CURL_INCLUDES_SIGNAL], [
147curl_includes_signal="\
148/* includes start */
149#ifdef HAVE_SYS_TYPES_H
150# include <sys/types.h>
151#endif
152#include <signal.h>
153/* includes end */"
154 AC_CHECK_HEADERS(
155 sys/types.h,
156 [], [], [$curl_includes_signal])
157])
160dnl CURL_INCLUDES_STDLIB
161dnl -------------------------------------------------
162dnl Set up variable with list of headers that must be
163dnl included when stdlib.h is to be included.
165AC_DEFUN([CURL_INCLUDES_STDLIB], [
166curl_includes_stdlib="\
167/* includes start */
168#ifdef HAVE_SYS_TYPES_H
169# include <sys/types.h>
170#endif
171#include <stdlib.h>
172/* includes end */"
173 AC_CHECK_HEADERS(
174 sys/types.h,
175 [], [], [$curl_includes_stdlib])
176])
179dnl CURL_INCLUDES_STRING
180dnl -------------------------------------------------
181dnl Set up variable with list of headers that must be
182dnl included when string(s).h is to be included.
184AC_DEFUN([CURL_INCLUDES_STRING], [
185curl_includes_string="\
186/* includes start */
187#ifdef HAVE_SYS_TYPES_H
188# include <sys/types.h>
189#endif
190#include <string.h>
191#ifdef HAVE_STRINGS_H
192# include <strings.h>
193#endif
194/* includes end */"
195 AC_CHECK_HEADERS(
196 sys/types.h strings.h,
197 [], [], [$curl_includes_string])
198])
201dnl CURL_INCLUDES_STROPTS
202dnl -------------------------------------------------
203dnl Set up variable with list of headers that must be
204dnl included when stropts.h is to be included.
206AC_DEFUN([CURL_INCLUDES_STROPTS], [
207curl_includes_stropts="\
208/* includes start */
209#ifdef HAVE_SYS_TYPES_H
210# include <sys/types.h>
211#endif
212#ifdef HAVE_UNISTD_H
213# include <unistd.h>
214#endif
215#ifndef _WIN32
216# include <sys/socket.h>
217#endif
218#ifdef HAVE_SYS_IOCTL_H
219# include <sys/ioctl.h>
220#endif
221#ifdef HAVE_STROPTS_H
222# include <stropts.h>
223#endif
224/* includes end */"
225 AC_CHECK_HEADERS(
226 sys/types.h unistd.h sys/ioctl.h stropts.h,
227 [], [], [$curl_includes_stropts])
228])
231dnl CURL_INCLUDES_SYS_SOCKET
232dnl -------------------------------------------------
233dnl Set up variable with list of headers that must be
234dnl included when sys/socket.h is to be included.
236AC_DEFUN([CURL_INCLUDES_SYS_SOCKET], [
237curl_includes_sys_socket="\
238/* includes start */
239#ifdef HAVE_SYS_TYPES_H
240# include <sys/types.h>
241#endif
242#ifndef _WIN32
243# include <sys/socket.h>
244#endif
245/* includes end */"
246 AC_CHECK_HEADERS(
247 sys/types.h,
248 [], [], [$curl_includes_sys_socket])
249])
252dnl CURL_INCLUDES_SYS_TYPES
253dnl -------------------------------------------------
254dnl Set up variable with list of headers that must be
255dnl included when sys/types.h is to be included.
257AC_DEFUN([CURL_INCLUDES_SYS_TYPES], [
258curl_includes_sys_types="\
259/* includes start */
260#ifdef HAVE_SYS_TYPES_H
261# include <sys/types.h>
262#endif
263/* includes end */"
264 AC_CHECK_HEADERS(
265 sys/types.h,
266 [], [], [$curl_includes_sys_types])
267])
270dnl CURL_INCLUDES_SYS_XATTR
271dnl -------------------------------------------------
272dnl Set up variable with list of headers that must be
273dnl included when sys/xattr.h is to be included.
275AC_DEFUN([CURL_INCLUDES_SYS_XATTR], [
276curl_includes_sys_xattr="\
277/* includes start */
278#ifdef HAVE_SYS_TYPES_H
279# include <sys/types.h>
280#endif
281#ifdef HAVE_SYS_XATTR_H
282# include <sys/xattr.h>
283#endif
284/* includes end */"
285 AC_CHECK_HEADERS(
286 sys/types.h sys/xattr.h,
287 [], [], [$curl_includes_sys_xattr])
288])
290dnl CURL_INCLUDES_TIME
291dnl -------------------------------------------------
292dnl Set up variable with list of headers that must be
293dnl included when time.h is to be included.
295AC_DEFUN([CURL_INCLUDES_TIME], [
296curl_includes_time="\
297/* includes start */
298#ifdef HAVE_SYS_TYPES_H
299# include <sys/types.h>
300#endif
301#if !defined(_WIN32) || defined(__MINGW32__)
302# include <sys/time.h>
303#endif
304#include <time.h>
305/* includes end */"
306 AC_CHECK_HEADERS(
307 sys/types.h,
308 [], [], [$curl_includes_time])
309])
312dnl CURL_INCLUDES_UNISTD
313dnl -------------------------------------------------
314dnl Set up variable with list of headers that must be
315dnl included when unistd.h is to be included.
317AC_DEFUN([CURL_INCLUDES_UNISTD], [
318curl_includes_unistd="\
319/* includes start */
320#ifdef HAVE_SYS_TYPES_H
321# include <sys/types.h>
322#endif
323#ifdef HAVE_UNISTD_H
324# include <unistd.h>
325#endif
326/* includes end */"
327 AC_CHECK_HEADERS(
328 sys/types.h unistd.h,
329 [], [], [$curl_includes_unistd])
330])
333dnl CURL_INCLUDES_WINSOCK2
334dnl -------------------------------------------------
335dnl Set up variable with list of headers that must be
336dnl included when winsock2.h is to be included.
338AC_DEFUN([CURL_INCLUDES_WINSOCK2], [
339curl_includes_winsock2="\
340/* includes start */
341#ifdef _WIN32
342# ifndef WIN32_LEAN_AND_MEAN
343# define WIN32_LEAN_AND_MEAN
344# endif
345# include <winsock2.h>
346#endif
347/* includes end */"
348 CURL_CHECK_NATIVE_WINDOWS
349])
352dnl CURL_INCLUDES_WS2TCPIP
353dnl -------------------------------------------------
354dnl Set up variable with list of headers that must be
355dnl included when ws2tcpip.h is to be included.
357AC_DEFUN([CURL_INCLUDES_WS2TCPIP], [
358curl_includes_ws2tcpip="\
359/* includes start */
360#ifdef _WIN32
361# ifndef WIN32_LEAN_AND_MEAN
362# define WIN32_LEAN_AND_MEAN
363# endif
364# include <winsock2.h>
365# include <ws2tcpip.h>
366#endif
367/* includes end */"
368 CURL_CHECK_NATIVE_WINDOWS
369])
372dnl CURL_INCLUDES_BSDSOCKET
373dnl -------------------------------------------------
374dnl Set up variable with list of headers that must be
375dnl included when bsdsocket.h is to be included.
377AC_DEFUN([CURL_INCLUDES_BSDSOCKET], [
378curl_includes_bsdsocket="\
379/* includes start */
380#ifdef HAVE_PROTO_BSDSOCKET_H
381# define __NO_NET_API
382# define __USE_INLINE__
383# include <proto/bsdsocket.h>
384# ifdef HAVE_SYS_IOCTL_H
385# include <sys/ioctl.h>
386# endif
387# ifdef __amigaos4__
388struct SocketIFace *ISocket = NULL;
389# else
390struct Library *SocketBase = NULL;
391# endif
392# define select(a, b, c, d, e) WaitSelect(a, b, c, d, e, 0)
393#endif
394/* includes end */"
395 AC_CHECK_HEADERS(
396 proto/bsdsocket.h,
397 [], [], [$curl_includes_bsdsocket])
398])
400dnl CURL_INCLUDES_NETIF
401dnl -------------------------------------------------
402dnl Set up variable with list of headers that must be
403dnl included when net/if.h is to be included.
405AC_DEFUN([CURL_INCLUDES_NETIF], [
406curl_includes_netif="\
407/* includes start */
408#ifdef HAVE_NET_IF_H
409# include <net/if.h>
410#endif
411/* includes end */"
412 AC_CHECK_HEADERS(
413 net/if.h,
414 [], [], [$curl_includes_netif])
415])
418dnl CURL_PREPROCESS_CALLCONV
419dnl -------------------------------------------------
420dnl Set up variable with a preprocessor block which
421dnl defines function calling convention.
423AC_DEFUN([CURL_PREPROCESS_CALLCONV], [
424curl_preprocess_callconv="\
425/* preprocess start */
426#ifdef _WIN32
427# define FUNCALLCONV __stdcall
428#else
429# define FUNCALLCONV
430#endif
431/* preprocess end */"
432])
435dnl CURL_CHECK_FUNC_ALARM
436dnl -------------------------------------------------
437dnl Verify if alarm is available, prototyped, and
438dnl can be compiled. If all of these are true, and
439dnl usage has not been previously disallowed with
440dnl shell variable curl_disallow_alarm, then
441dnl HAVE_ALARM is defined.
443AC_DEFUN([CURL_CHECK_FUNC_ALARM], [
444 AC_REQUIRE([CURL_INCLUDES_UNISTD])
446 tst_links_alarm="unknown"
447 tst_proto_alarm="unknown"
448 tst_compi_alarm="unknown"
449 tst_allow_alarm="unknown"
451 AC_MSG_CHECKING([if alarm can be linked])
452 AC_LINK_IFELSE([
453 AC_LANG_FUNC_LINK_TRY([alarm])
454 ],[
455 AC_MSG_RESULT([yes])
456 tst_links_alarm="yes"
457 ],[
458 AC_MSG_RESULT([no])
459 tst_links_alarm="no"
460 ])
462 if test "$tst_links_alarm" = "yes"; then
463 AC_MSG_CHECKING([if alarm is prototyped])
464 AC_EGREP_CPP([alarm],[
465 $curl_includes_unistd
466 ],[
467 AC_MSG_RESULT([yes])
468 tst_proto_alarm="yes"
469 ],[
470 AC_MSG_RESULT([no])
471 tst_proto_alarm="no"
472 ])
473 fi
475 if test "$tst_proto_alarm" = "yes"; then
476 AC_MSG_CHECKING([if alarm is compilable])
477 AC_COMPILE_IFELSE([
478 AC_LANG_PROGRAM([[
479 $curl_includes_unistd
480 ]],[[
481 if(alarm(0))
482 return 1;
483 ]])
484 ],[
485 AC_MSG_RESULT([yes])
486 tst_compi_alarm="yes"
487 ],[
488 AC_MSG_RESULT([no])
489 tst_compi_alarm="no"
490 ])
491 fi
493 if test "$tst_compi_alarm" = "yes"; then
494 AC_MSG_CHECKING([if alarm usage allowed])
495 if test "x$curl_disallow_alarm" != "xyes"; then
496 AC_MSG_RESULT([yes])
497 tst_allow_alarm="yes"
498 else
499 AC_MSG_RESULT([no])
500 tst_allow_alarm="no"
501 fi
502 fi
504 AC_MSG_CHECKING([if alarm might be used])
505 if test "$tst_links_alarm" = "yes" &&
506 test "$tst_proto_alarm" = "yes" &&
507 test "$tst_compi_alarm" = "yes" &&
508 test "$tst_allow_alarm" = "yes"; then
509 AC_MSG_RESULT([yes])
510 AC_DEFINE_UNQUOTED(HAVE_ALARM, 1,
511 [Define to 1 if you have the alarm function.])
512 curl_cv_func_alarm="yes"
513 else
514 AC_MSG_RESULT([no])
515 curl_cv_func_alarm="no"
516 fi
517])
520dnl CURL_CHECK_FUNC_BASENAME
521dnl -------------------------------------------------
522dnl Verify if basename is available, prototyped, and
523dnl can be compiled. If all of these are true, and
524dnl usage has not been previously disallowed with
525dnl shell variable curl_disallow_basename, then
526dnl HAVE_BASENAME is defined.
528AC_DEFUN([CURL_CHECK_FUNC_BASENAME], [
529 AC_REQUIRE([CURL_INCLUDES_STRING])
530 AC_REQUIRE([CURL_INCLUDES_LIBGEN])
531 AC_REQUIRE([CURL_INCLUDES_UNISTD])
533 tst_links_basename="unknown"
534 tst_proto_basename="unknown"
535 tst_compi_basename="unknown"
536 tst_allow_basename="unknown"
538 AC_MSG_CHECKING([if basename can be linked])
539 AC_LINK_IFELSE([
540 AC_LANG_FUNC_LINK_TRY([basename])
541 ],[
542 AC_MSG_RESULT([yes])
543 tst_links_basename="yes"
544 ],[
545 AC_MSG_RESULT([no])
546 tst_links_basename="no"
547 ])
549 if test "$tst_links_basename" = "yes"; then
550 AC_MSG_CHECKING([if basename is prototyped])
551 AC_EGREP_CPP([basename],[
552 $curl_includes_string
553 $curl_includes_libgen
554 $curl_includes_unistd
555 ],[
556 AC_MSG_RESULT([yes])
557 tst_proto_basename="yes"
558 ],[
559 AC_MSG_RESULT([no])
560 tst_proto_basename="no"
561 ])
562 fi
564 if test "$tst_proto_basename" = "yes"; then
565 AC_MSG_CHECKING([if basename is compilable])
566 AC_COMPILE_IFELSE([
567 AC_LANG_PROGRAM([[
568 $curl_includes_string
569 $curl_includes_libgen
570 $curl_includes_unistd
571 ]],[[
572 if(basename(0))
573 return 1;
574 ]])
575 ],[
576 AC_MSG_RESULT([yes])
577 tst_compi_basename="yes"
578 ],[
579 AC_MSG_RESULT([no])
580 tst_compi_basename="no"
581 ])
582 fi
584 if test "$tst_compi_basename" = "yes"; then
585 AC_MSG_CHECKING([if basename usage allowed])
586 if test "x$curl_disallow_basename" != "xyes"; then
587 AC_MSG_RESULT([yes])
588 tst_allow_basename="yes"
589 else
590 AC_MSG_RESULT([no])
591 tst_allow_basename="no"
592 fi
593 fi
595 AC_MSG_CHECKING([if basename might be used])
596 if test "$tst_links_basename" = "yes" &&
597 test "$tst_proto_basename" = "yes" &&
598 test "$tst_compi_basename" = "yes" &&
599 test "$tst_allow_basename" = "yes"; then
600 AC_MSG_RESULT([yes])
601 AC_DEFINE_UNQUOTED(HAVE_BASENAME, 1,
602 [Define to 1 if you have the basename function.])
603 curl_cv_func_basename="yes"
604 else
605 AC_MSG_RESULT([no])
606 curl_cv_func_basename="no"
607 fi
608])
611dnl CURL_CHECK_FUNC_CLOSESOCKET
612dnl -------------------------------------------------
613dnl Verify if closesocket is available, prototyped, and
614dnl can be compiled. If all of these are true, and
615dnl usage has not been previously disallowed with
616dnl shell variable curl_disallow_closesocket, then
617dnl HAVE_CLOSESOCKET is defined.
619AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET], [
620 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])
622 tst_links_closesocket="unknown"
623 tst_proto_closesocket="unknown"
624 tst_compi_closesocket="unknown"
625 tst_allow_closesocket="unknown"
627 AC_MSG_CHECKING([if closesocket can be linked])
628 AC_LINK_IFELSE([
629 AC_LANG_PROGRAM([[
630 $curl_includes_winsock2
631 ]],[[
632 if(closesocket(0))
633 return 1;
634 ]])
635 ],[
636 AC_MSG_RESULT([yes])
637 tst_links_closesocket="yes"
638 ],[
639 AC_MSG_RESULT([no])
640 tst_links_closesocket="no"
641 ])
643 if test "$tst_links_closesocket" = "yes"; then
644 AC_MSG_CHECKING([if closesocket is prototyped])
645 AC_EGREP_CPP([closesocket],[
646 $curl_includes_winsock2
647 ],[
648 AC_MSG_RESULT([yes])
649 tst_proto_closesocket="yes"
650 ],[
651 AC_MSG_RESULT([no])
652 tst_proto_closesocket="no"
653 ])
654 fi
656 if test "$tst_proto_closesocket" = "yes"; then
657 AC_MSG_CHECKING([if closesocket is compilable])
658 AC_COMPILE_IFELSE([
659 AC_LANG_PROGRAM([[
660 $curl_includes_winsock2
661 ]],[[
662 if(closesocket(0))
663 return 1;
664 ]])
665 ],[
666 AC_MSG_RESULT([yes])
667 tst_compi_closesocket="yes"
668 ],[
669 AC_MSG_RESULT([no])
670 tst_compi_closesocket="no"
671 ])
672 fi
674 if test "$tst_compi_closesocket" = "yes"; then
675 AC_MSG_CHECKING([if closesocket usage allowed])
676 if test "x$curl_disallow_closesocket" != "xyes"; then
677 AC_MSG_RESULT([yes])
678 tst_allow_closesocket="yes"
679 else
680 AC_MSG_RESULT([no])
681 tst_allow_closesocket="no"
682 fi
683 fi
685 AC_MSG_CHECKING([if closesocket might be used])
686 if test "$tst_links_closesocket" = "yes" &&
687 test "$tst_proto_closesocket" = "yes" &&
688 test "$tst_compi_closesocket" = "yes" &&
689 test "$tst_allow_closesocket" = "yes"; then
690 AC_MSG_RESULT([yes])
691 AC_DEFINE_UNQUOTED(HAVE_CLOSESOCKET, 1,
692 [Define to 1 if you have the closesocket function.])
693 curl_cv_func_closesocket="yes"
694 else
695 AC_MSG_RESULT([no])
696 curl_cv_func_closesocket="no"
697 fi
698])
701dnl CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
702dnl -------------------------------------------------
703dnl Verify if CloseSocket is available, prototyped, and
704dnl can be compiled. If all of these are true, and
705dnl usage has not been previously disallowed with
706dnl shell variable curl_disallow_closesocket_camel,
707dnl then HAVE_CLOSESOCKET_CAMEL is defined.
709AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET_CAMEL], [
710 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])
711 AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])
713 tst_links_closesocket_camel="unknown"
714 tst_compi_closesocket_camel="unknown"
715 tst_allow_closesocket_camel="unknown"
717 AC_MSG_CHECKING([if CloseSocket can be linked])
718 AC_LINK_IFELSE([
719 AC_LANG_PROGRAM([[
720 $curl_includes_bsdsocket
721 $curl_includes_sys_socket
722 ]],[[
723 if(CloseSocket(0))
724 return 1;
725 ]])
726 ],[
727 AC_MSG_RESULT([yes])
728 tst_links_closesocket_camel="yes"
729 ],[
730 AC_MSG_RESULT([no])
731 tst_links_closesocket_camel="no"
732 ])
734 if test "$tst_links_closesocket_camel" = "yes"; then
735 AC_MSG_CHECKING([if CloseSocket is compilable])
736 AC_COMPILE_IFELSE([
737 AC_LANG_PROGRAM([[
738 $curl_includes_bsdsocket
739 $curl_includes_sys_socket
740 ]],[[
741 if(CloseSocket(0))
742 return 1;
743 ]])
744 ],[
745 AC_MSG_RESULT([yes])
746 tst_compi_closesocket_camel="yes"
747 ],[
748 AC_MSG_RESULT([no])
749 tst_compi_closesocket_camel="no"
750 ])
751 fi
753 if test "$tst_compi_closesocket_camel" = "yes"; then
754 AC_MSG_CHECKING([if CloseSocket usage allowed])
755 if test "x$curl_disallow_closesocket_camel" != "xyes"; then
756 AC_MSG_RESULT([yes])
757 tst_allow_closesocket_camel="yes"
758 else
759 AC_MSG_RESULT([no])
760 tst_allow_closesocket_camel="no"
761 fi
762 fi
764 AC_MSG_CHECKING([if CloseSocket might be used])
765 if test "$tst_links_closesocket_camel" = "yes" &&
766 test "$tst_compi_closesocket_camel" = "yes" &&
767 test "$tst_allow_closesocket_camel" = "yes"; then
768 AC_MSG_RESULT([yes])
769 AC_DEFINE_UNQUOTED(HAVE_CLOSESOCKET_CAMEL, 1,
770 [Define to 1 if you have the CloseSocket camel case function.])
771 curl_cv_func_closesocket_camel="yes"
772 else
773 AC_MSG_RESULT([no])
774 curl_cv_func_closesocket_camel="no"
775 fi
776])
778dnl CURL_CHECK_FUNC_FCNTL
779dnl -------------------------------------------------
780dnl Verify if fcntl is available, prototyped, and
781dnl can be compiled. If all of these are true, and
782dnl usage has not been previously disallowed with
783dnl shell variable curl_disallow_fcntl, then
784dnl HAVE_FCNTL is defined.
786AC_DEFUN([CURL_CHECK_FUNC_FCNTL], [
787 AC_REQUIRE([CURL_INCLUDES_FCNTL])
789 tst_links_fcntl="unknown"
790 tst_proto_fcntl="unknown"
791 tst_compi_fcntl="unknown"
792 tst_allow_fcntl="unknown"
794 AC_MSG_CHECKING([if fcntl can be linked])
795 AC_LINK_IFELSE([
796 AC_LANG_FUNC_LINK_TRY([fcntl])
797 ],[
798 AC_MSG_RESULT([yes])
799 tst_links_fcntl="yes"
800 ],[
801 AC_MSG_RESULT([no])
802 tst_links_fcntl="no"
803 ])
805 if test "$tst_links_fcntl" = "yes"; then
806 AC_MSG_CHECKING([if fcntl is prototyped])
807 AC_EGREP_CPP([fcntl],[
808 $curl_includes_fcntl
809 ],[
810 AC_MSG_RESULT([yes])
811 tst_proto_fcntl="yes"
812 ],[
813 AC_MSG_RESULT([no])
814 tst_proto_fcntl="no"
815 ])
816 fi
818 if test "$tst_proto_fcntl" = "yes"; then
819 AC_MSG_CHECKING([if fcntl is compilable])
820 AC_COMPILE_IFELSE([
821 AC_LANG_PROGRAM([[
822 $curl_includes_fcntl
823 ]],[[
824 if(fcntl(0, 0, 0))
825 return 1;
826 ]])
827 ],[
828 AC_MSG_RESULT([yes])
829 tst_compi_fcntl="yes"
830 ],[
831 AC_MSG_RESULT([no])
832 tst_compi_fcntl="no"
833 ])
834 fi
836 if test "$tst_compi_fcntl" = "yes"; then
837 AC_MSG_CHECKING([if fcntl usage allowed])
838 if test "x$curl_disallow_fcntl" != "xyes"; then
839 AC_MSG_RESULT([yes])
840 tst_allow_fcntl="yes"
841 else
842 AC_MSG_RESULT([no])
843 tst_allow_fcntl="no"
844 fi
845 fi
847 AC_MSG_CHECKING([if fcntl might be used])
848 if test "$tst_links_fcntl" = "yes" &&
849 test "$tst_proto_fcntl" = "yes" &&
850 test "$tst_compi_fcntl" = "yes" &&
851 test "$tst_allow_fcntl" = "yes"; then
852 AC_MSG_RESULT([yes])
853 AC_DEFINE_UNQUOTED(HAVE_FCNTL, 1,
854 [Define to 1 if you have the fcntl function.])
855 curl_cv_func_fcntl="yes"
856 CURL_CHECK_FUNC_FCNTL_O_NONBLOCK
857 else
858 AC_MSG_RESULT([no])
859 curl_cv_func_fcntl="no"
860 fi
861])
864dnl CURL_CHECK_FUNC_FCNTL_O_NONBLOCK
865dnl -------------------------------------------------
866dnl Verify if fcntl with status flag O_NONBLOCK is
867dnl available, can be compiled, and seems to work. If
868dnl all of these are true, then HAVE_FCNTL_O_NONBLOCK
869dnl is defined.
871AC_DEFUN([CURL_CHECK_FUNC_FCNTL_O_NONBLOCK], [
873 tst_compi_fcntl_o_nonblock="unknown"
874 tst_allow_fcntl_o_nonblock="unknown"
876 case $host_os in
877 sunos4* | aix3*)
878 dnl O_NONBLOCK does not work on these platforms
879 curl_disallow_fcntl_o_nonblock="yes"
880 ;;
881 esac
883 if test "$curl_cv_func_fcntl" = "yes"; then
884 AC_MSG_CHECKING([if fcntl O_NONBLOCK is compilable])
885 AC_COMPILE_IFELSE([
886 AC_LANG_PROGRAM([[
887 $curl_includes_fcntl
888 ]],[[
889 int flags = 0;
890 if(fcntl(0, F_SETFL, flags | O_NONBLOCK))
891 return 1;
892 ]])
893 ],[
894 AC_MSG_RESULT([yes])
895 tst_compi_fcntl_o_nonblock="yes"
896 ],[
897 AC_MSG_RESULT([no])
898 tst_compi_fcntl_o_nonblock="no"
899 ])
900 fi
902 if test "$tst_compi_fcntl_o_nonblock" = "yes"; then
903 AC_MSG_CHECKING([if fcntl O_NONBLOCK usage allowed])
904 if test "x$curl_disallow_fcntl_o_nonblock" != "xyes"; then
905 AC_MSG_RESULT([yes])
906 tst_allow_fcntl_o_nonblock="yes"
907 else
908 AC_MSG_RESULT([no])
909 tst_allow_fcntl_o_nonblock="no"
910 fi
911 fi
913 AC_MSG_CHECKING([if fcntl O_NONBLOCK might be used])
914 if test "$tst_compi_fcntl_o_nonblock" = "yes" &&
915 test "$tst_allow_fcntl_o_nonblock" = "yes"; then
916 AC_MSG_RESULT([yes])
917 AC_DEFINE_UNQUOTED(HAVE_FCNTL_O_NONBLOCK, 1,
918 [Define to 1 if you have a working fcntl O_NONBLOCK function.])
919 curl_cv_func_fcntl_o_nonblock="yes"
920 else
921 AC_MSG_RESULT([no])
922 curl_cv_func_fcntl_o_nonblock="no"
923 fi
924])
927dnl CURL_CHECK_FUNC_FREEADDRINFO
928dnl -------------------------------------------------
929dnl Verify if freeaddrinfo is available, prototyped,
930dnl and can be compiled. If all of these are true,
931dnl and usage has not been previously disallowed with
932dnl shell variable curl_disallow_freeaddrinfo, then
933dnl HAVE_FREEADDRINFO is defined.
935AC_DEFUN([CURL_CHECK_FUNC_FREEADDRINFO], [
936 AC_REQUIRE([CURL_INCLUDES_WS2TCPIP])
937 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])
938 AC_REQUIRE([CURL_INCLUDES_NETDB])
940 tst_links_freeaddrinfo="unknown"
941 tst_proto_freeaddrinfo="unknown"
942 tst_compi_freeaddrinfo="unknown"
943 tst_allow_freeaddrinfo="unknown"
945 AC_MSG_CHECKING([if freeaddrinfo can be linked])
946 AC_LINK_IFELSE([
947 AC_LANG_PROGRAM([[
948 $curl_includes_ws2tcpip
949 $curl_includes_sys_socket
950 $curl_includes_netdb
951 ]],[[
952 freeaddrinfo(0);
953 ]])
954 ],[
955 AC_MSG_RESULT([yes])
956 tst_links_freeaddrinfo="yes"
957 ],[
958 AC_MSG_RESULT([no])
959 tst_links_freeaddrinfo="no"
960 ])
962 if test "$tst_links_freeaddrinfo" = "yes"; then
963 AC_MSG_CHECKING([if freeaddrinfo is prototyped])
964 AC_EGREP_CPP([freeaddrinfo],[
965 $curl_includes_ws2tcpip
966 $curl_includes_sys_socket
967 $curl_includes_netdb
968 ],[
969 AC_MSG_RESULT([yes])
970 tst_proto_freeaddrinfo="yes"
971 ],[
972 AC_MSG_RESULT([no])
973 tst_proto_freeaddrinfo="no"
974 ])
975 fi
977 if test "$tst_proto_freeaddrinfo" = "yes"; then
978 AC_MSG_CHECKING([if freeaddrinfo is compilable])
979 AC_COMPILE_IFELSE([
980 AC_LANG_PROGRAM([[
981 $curl_includes_ws2tcpip
982 $curl_includes_sys_socket
983 $curl_includes_netdb
984 ]],[[
985 freeaddrinfo(0);
986 ]])
987 ],[
988 AC_MSG_RESULT([yes])
989 tst_compi_freeaddrinfo="yes"
990 ],[
991 AC_MSG_RESULT([no])
992 tst_compi_freeaddrinfo="no"
993 ])
994 fi
996 if test "$tst_compi_freeaddrinfo" = "yes"; then
997 AC_MSG_CHECKING([if freeaddrinfo usage allowed])
998 if test "x$curl_disallow_freeaddrinfo" != "xyes"; then
999 AC_MSG_RESULT([yes])
1000 tst_allow_freeaddrinfo="yes"
1001 else
1002 AC_MSG_RESULT([no])
1003 tst_allow_freeaddrinfo="no"
1004 fi
1005 fi
1007 AC_MSG_CHECKING([if freeaddrinfo might be used])
1008 if test "$tst_links_freeaddrinfo" = "yes" &&
1009 test "$tst_proto_freeaddrinfo" = "yes" &&
1010 test "$tst_compi_freeaddrinfo" = "yes" &&
1011 test "$tst_allow_freeaddrinfo" = "yes"; then
1012 AC_MSG_RESULT([yes])
1013 AC_DEFINE_UNQUOTED(HAVE_FREEADDRINFO, 1,
1014 [Define to 1 if you have the freeaddrinfo function.])
1015 curl_cv_func_freeaddrinfo="yes"
1016 else
1017 AC_MSG_RESULT([no])
1018 curl_cv_func_freeaddrinfo="no"
1019 fi
1020])
1023dnl CURL_CHECK_FUNC_FSETXATTR
1024dnl -------------------------------------------------
1025dnl Verify if fsetxattr is available, prototyped, and
1026dnl can be compiled. If all of these are true, and
1027dnl usage has not been previously disallowed with
1028dnl shell variable curl_disallow_fsetxattr, then
1029dnl HAVE_FSETXATTR is defined.
1031AC_DEFUN([CURL_CHECK_FUNC_FSETXATTR], [
1032 AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])
1034 tst_links_fsetxattr="unknown"
1035 tst_proto_fsetxattr="unknown"
1036 tst_compi_fsetxattr="unknown"
1037 tst_allow_fsetxattr="unknown"
1038 tst_nargs_fsetxattr="unknown"
1040 AC_MSG_CHECKING([if fsetxattr can be linked])
1041 AC_LINK_IFELSE([
1042 AC_LANG_FUNC_LINK_TRY([fsetxattr])
1043 ],[
1044 AC_MSG_RESULT([yes])
1045 tst_links_fsetxattr="yes"
1046 ],[
1047 AC_MSG_RESULT([no])
1048 tst_links_fsetxattr="no"
1049 ])
1051 if test "$tst_links_fsetxattr" = "yes"; then
1052 AC_MSG_CHECKING([if fsetxattr is prototyped])
1053 AC_EGREP_CPP([fsetxattr],[
1054 $curl_includes_sys_xattr
1055 ],[
1056 AC_MSG_RESULT([yes])
1057 tst_proto_fsetxattr="yes"
1058 ],[
1059 AC_MSG_RESULT([no])
1060 tst_proto_fsetxattr="no"
1061 ])
1062 fi
1064 if test "$tst_proto_fsetxattr" = "yes"; then
1065 if test "$tst_nargs_fsetxattr" = "unknown"; then
1066 AC_MSG_CHECKING([if fsetxattr takes 5 args.])
1067 AC_COMPILE_IFELSE([
1068 AC_LANG_PROGRAM([[
1069 $curl_includes_sys_xattr
1070 ]],[[
1071 if(fsetxattr(0, "", 0, 0, 0))
1072 return 1;
1073 ]])
1074 ],[
1075 AC_MSG_RESULT([yes])
1076 tst_compi_fsetxattr="yes"
1077 tst_nargs_fsetxattr="5"
1078 ],[
1079 AC_MSG_RESULT([no])
1080 tst_compi_fsetxattr="no"
1081 ])
1082 fi
1083 if test "$tst_nargs_fsetxattr" = "unknown"; then
1084 AC_MSG_CHECKING([if fsetxattr takes 6 args.])
1085 AC_COMPILE_IFELSE([
1086 AC_LANG_PROGRAM([[
1087 $curl_includes_sys_xattr
1088 ]],[[
1089 if(fsetxattr(0, 0, 0, 0, 0, 0))
1090 return 1;
1091 ]])
1092 ],[
1093 AC_MSG_RESULT([yes])
1094 tst_compi_fsetxattr="yes"
1095 tst_nargs_fsetxattr="6"
1096 ],[
1097 AC_MSG_RESULT([no])
1098 tst_compi_fsetxattr="no"
1099 ])
1100 fi
1101 AC_MSG_CHECKING([if fsetxattr is compilable])
1102 if test "$tst_compi_fsetxattr" = "yes"; then
1103 AC_MSG_RESULT([yes])
1104 else
1105 AC_MSG_RESULT([no])
1106 fi
1107 fi
1109 if test "$tst_compi_fsetxattr" = "yes"; then
1110 AC_MSG_CHECKING([if fsetxattr usage allowed])
1111 if test "x$curl_disallow_fsetxattr" != "xyes"; then
1112 AC_MSG_RESULT([yes])
1113 tst_allow_fsetxattr="yes"
1114 else
1115 AC_MSG_RESULT([no])
1116 tst_allow_fsetxattr="no"
1117 fi
1118 fi
1120 AC_MSG_CHECKING([if fsetxattr might be used])
1121 if test "$tst_links_fsetxattr" = "yes" &&
1122 test "$tst_proto_fsetxattr" = "yes" &&
1123 test "$tst_compi_fsetxattr" = "yes" &&
1124 test "$tst_allow_fsetxattr" = "yes"; then
1125 AC_MSG_RESULT([yes])
1126 AC_DEFINE_UNQUOTED(HAVE_FSETXATTR, 1,
1127 [Define to 1 if you have the fsetxattr function.])
1128 dnl AC_DEFINE_UNQUOTED(FSETXATTR_ARGS, $tst_nargs_fsetxattr,
1129 dnl [Specifies the number of arguments to fsetxattr])
1131 if test "$tst_nargs_fsetxattr" -eq "5"; then
1132 AC_DEFINE(HAVE_FSETXATTR_5, 1, [fsetxattr() takes 5 args])
1133 elif test "$tst_nargs_fsetxattr" -eq "6"; then
1134 AC_DEFINE(HAVE_FSETXATTR_6, 1, [fsetxattr() takes 6 args])
1135 fi
1137 curl_cv_func_fsetxattr="yes"
1138 else
1139 AC_MSG_RESULT([no])
1140 curl_cv_func_fsetxattr="no"
1141 fi
1142])
1145dnl CURL_CHECK_FUNC_GETADDRINFO
1146dnl -------------------------------------------------
1147dnl Verify if getaddrinfo is available, prototyped, can
1148dnl be compiled and seems to work. If all of these are
1149dnl true, and usage has not been previously disallowed
1150dnl with shell variable curl_disallow_getaddrinfo, then
1151dnl HAVE_GETADDRINFO is defined. Additionally when
1152dnl HAVE_GETADDRINFO gets defined this also attempts
1153dnl to find out if getaddrinfo happens to be thread-safe,
1154dnl defining HAVE_GETADDRINFO_THREADSAFE when true.
1156AC_DEFUN([CURL_CHECK_FUNC_GETADDRINFO], [
1157 AC_REQUIRE([CURL_INCLUDES_WS2TCPIP])
1158 AC_REQUIRE([CURL_INCLUDES_STDLIB])
1159 AC_REQUIRE([CURL_INCLUDES_STRING])
1160 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])
1161 AC_REQUIRE([CURL_INCLUDES_NETDB])
1162 AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])
1164 tst_links_getaddrinfo="unknown"
1165 tst_proto_getaddrinfo="unknown"
1166 tst_compi_getaddrinfo="unknown"
1167 tst_works_getaddrinfo="unknown"
1168 tst_allow_getaddrinfo="unknown"
1169 tst_tsafe_getaddrinfo="unknown"
1171 AC_MSG_CHECKING([if getaddrinfo can be linked])
1172 AC_LINK_IFELSE([
1173 AC_LANG_PROGRAM([[
1174 $curl_includes_ws2tcpip
1175 $curl_includes_sys_socket
1176 $curl_includes_netdb
1177 ]],[[
1178 struct addrinfo *ai = 0;
1179 if(getaddrinfo(0, 0, 0, &ai))
1180 return 1;
1181 ]])
1182 ],[
1183 AC_MSG_RESULT([yes])
1184 tst_links_getaddrinfo="yes"
1185 ],[
1186 AC_MSG_RESULT([no])
1187 tst_links_getaddrinfo="no"
1188 ])
1190 if test "$tst_links_getaddrinfo" = "yes"; then
1191 AC_MSG_CHECKING([if getaddrinfo is prototyped])
1192 AC_EGREP_CPP([getaddrinfo],[
1193 $curl_includes_ws2tcpip
1194 $curl_includes_sys_socket
1195 $curl_includes_netdb
1196 ],[
1197 AC_MSG_RESULT([yes])
1198 tst_proto_getaddrinfo="yes"
1199 ],[
1200 AC_MSG_RESULT([no])
1201 tst_proto_getaddrinfo="no"
1202 ])
1203 fi
1205 if test "$tst_proto_getaddrinfo" = "yes"; then
1206 AC_MSG_CHECKING([if getaddrinfo is compilable])
1207 AC_COMPILE_IFELSE([
1208 AC_LANG_PROGRAM([[
1209 $curl_includes_ws2tcpip
1210 $curl_includes_sys_socket
1211 $curl_includes_netdb
1212 ]],[[
1213 struct addrinfo *ai = 0;
1214 if(getaddrinfo(0, 0, 0, &ai))
1215 return 1;
1216 ]])
1217 ],[
1218 AC_MSG_RESULT([yes])
1219 tst_compi_getaddrinfo="yes"
1220 ],[
1221 AC_MSG_RESULT([no])
1222 tst_compi_getaddrinfo="no"
1223 ])
1224 fi
1226 dnl only do runtime verification when not cross-compiling
1227 if test "$cross_compiling" != "yes" &&
1228 test "$tst_compi_getaddrinfo" = "yes"; then
1229 AC_MSG_CHECKING([if getaddrinfo seems to work])
1230 CURL_RUN_IFELSE([
1231 AC_LANG_PROGRAM([[
1232 $curl_includes_ws2tcpip
1233 $curl_includes_stdlib
1234 $curl_includes_string
1235 $curl_includes_sys_socket
1236 $curl_includes_netdb
1237 ]],[[
1238 struct addrinfo hints;
1239 struct addrinfo *ai = 0;
1240 int error;
1241 int exitcode;
1243 #ifdef _WIN32
1244 WSADATA wsa;
1245 if(WSAStartup(MAKEWORD(2, 2), &wsa))
1246 return 2;
1247 #endif
1249 memset(&hints, 0, sizeof(hints));
1250 hints.ai_flags = AI_NUMERICHOST;
1251 hints.ai_family = AF_UNSPEC;
1252 hints.ai_socktype = SOCK_STREAM;
1253 error = getaddrinfo("127.0.0.1", 0, &hints, &ai);
1254 if(error || !ai)
1255 exitcode = 1; /* fail */
1256 else {
1257 freeaddrinfo(ai);
1258 exitcode = 0;
1259 }
1260 #ifdef _WIN32
1261 WSACleanup();
1262 #endif
1263 return exitcode;
1264 ]])
1265 ],[
1266 AC_MSG_RESULT([yes])
1267 tst_works_getaddrinfo="yes"
1268 ],[
1269 AC_MSG_RESULT([no])
1270 tst_works_getaddrinfo="no"
1271 ])
1272 fi
1274 if test "$tst_compi_getaddrinfo" = "yes" &&
1275 test "$tst_works_getaddrinfo" != "no"; then
1276 AC_MSG_CHECKING([if getaddrinfo usage allowed])
1277 if test "x$curl_disallow_getaddrinfo" != "xyes"; then
1278 AC_MSG_RESULT([yes])
1279 tst_allow_getaddrinfo="yes"
1280 else
1281 AC_MSG_RESULT([no])
1282 tst_allow_getaddrinfo="no"
1283 fi
1284 fi
1286 AC_MSG_CHECKING([if getaddrinfo might be used])
1287 if test "$tst_proto_getaddrinfo" = "yes" &&
1288 test "$tst_compi_getaddrinfo" = "yes" &&
1289 test "$tst_allow_getaddrinfo" = "yes" &&
1290 test "$tst_works_getaddrinfo" != "no"; then
1291 AC_MSG_RESULT([yes])
1292 AC_DEFINE_UNQUOTED(HAVE_GETADDRINFO, 1,
1293 [Define to 1 if you have a working getaddrinfo function.])
1294 curl_cv_func_getaddrinfo="yes"
1295 else
1296 AC_MSG_RESULT([no])
1297 curl_cv_func_getaddrinfo="no"
1298 curl_cv_func_getaddrinfo_threadsafe="no"
1299 fi
1301 if test "$curl_cv_func_getaddrinfo" = "yes"; then
1302 AC_MSG_CHECKING([if getaddrinfo is thread-safe])
1303 if test "$curl_cv_apple" = "yes"; then
1304 dnl Darwin 9+ and macOS 10.5+
1305 tst_tsafe_getaddrinfo="yes"
1306 fi
1307 case $host_os in
1308 aix[[1234]].* | aix5.[[01]].*)
1309 dnl AIX 5.1 and older
1310 tst_tsafe_getaddrinfo="no"
1311 ;;
1312 aix*)
1313 dnl AIX 5.2 and newer
1314 tst_tsafe_getaddrinfo="yes"
1315 ;;
1316 darwin[[12345678]].*)
1317 dnl Darwin <=8.0 and macOS <=10.4
1318 tst_tsafe_getaddrinfo="no"
1319 ;;
1320 dragonfly1.* | dragonfly2.[[01]])
1321 dnl DragonFly BSD <=2.1.0
1322 tst_tsafe_getaddrinfo="no"
1323 ;;
1324 dragonfly*)
1325 dnl DragonFly BSD 2.2.0+
1326 tst_tsafe_getaddrinfo="yes"
1327 ;;
1328 freebsd[[1234]].* | freebsd5.[[1234]]*)
1329 dnl FreeBSD 5.4 and older
1330 tst_tsafe_getaddrinfo="no"
1331 ;;
1332 freebsd*)
1333 dnl FreeBSD 5.5 and newer
1334 tst_tsafe_getaddrinfo="yes"
1335 ;;
1336 hpux[[123456789]].* | hpux10.* | hpux11.0* | hpux11.10*)
1337 dnl HP-UX 11.10 and older
1338 tst_tsafe_getaddrinfo="no"
1339 ;;
1340 hpux*)
1341 dnl HP-UX 11.11 and newer
1342 tst_tsafe_getaddrinfo="yes"
1343 ;;
1344 midnightbsd*)
1345 dnl all MidnightBSD versions
1346 tst_tsafe_getaddrinfo="yes"
1347 ;;
1348 netbsd[[123]].*)
1349 dnl NetBSD 3.X and older
1350 tst_tsafe_getaddrinfo="no"
1351 ;;
1352 netbsd*)
1353 dnl NetBSD 4.X and newer
1354 tst_tsafe_getaddrinfo="yes"
1355 ;;
1356 openbsd[[1234]].* | openbsd5.[[0123]])
1357 dnl OpenBSD <=5.3
1358 tst_tsafe_getaddrinfo="no"
1359 ;;
1360 openbsd*)
1361 dnl OpenBSD 5.4+
1362 tst_tsafe_getaddrinfo="yes"
1363 ;;
1364 *bsd*)
1365 dnl All other BSD's
1366 tst_tsafe_getaddrinfo="no"
1367 ;;
1368 solaris2*)
1369 dnl Solaris which have it
1370 tst_tsafe_getaddrinfo="yes"
1371 ;;
1372 esac
1373 if test "$tst_tsafe_getaddrinfo" = "unknown" &&
1374 test "$curl_cv_native_windows" = "yes"; then
1375 tst_tsafe_getaddrinfo="yes"
1376 fi
1377 if test "$tst_tsafe_getaddrinfo" = "unknown"; then
1378 tst_tsafe_getaddrinfo="yes"
1379 fi
1380 AC_MSG_RESULT([$tst_tsafe_getaddrinfo])
1381 if test "$tst_tsafe_getaddrinfo" = "yes"; then
1382 AC_DEFINE_UNQUOTED(HAVE_GETADDRINFO_THREADSAFE, 1,
1383 [Define to 1 if the getaddrinfo function is thread-safe.])
1384 curl_cv_func_getaddrinfo_threadsafe="yes"
1385 else
1386 curl_cv_func_getaddrinfo_threadsafe="no"
1387 fi
1388 fi
1389])
1392dnl CURL_CHECK_FUNC_GETHOSTBYNAME_R
1393dnl -------------------------------------------------
1394dnl Verify if gethostbyname_r is available, prototyped,
1395dnl and can be compiled. If all of these are true, and
1396dnl usage has not been previously disallowed with
1397dnl shell variable curl_disallow_gethostbyname_r, then
1398dnl HAVE_GETHOSTBYNAME_R is defined.
1400AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYNAME_R], [
1401 AC_REQUIRE([CURL_INCLUDES_NETDB])
1403 tst_links_gethostbyname_r="unknown"
1404 tst_proto_gethostbyname_r="unknown"
1405 tst_compi_gethostbyname_r="unknown"
1406 tst_allow_gethostbyname_r="unknown"
1407 tst_nargs_gethostbyname_r="unknown"
1409 AC_MSG_CHECKING([if gethostbyname_r can be linked])
1410 AC_LINK_IFELSE([
1411 AC_LANG_FUNC_LINK_TRY([gethostbyname_r])
1412 ],[
1413 AC_MSG_RESULT([yes])
1414 tst_links_gethostbyname_r="yes"
1415 ],[
1416 AC_MSG_RESULT([no])
1417 tst_links_gethostbyname_r="no"
1418 ])
1420 if test "$tst_links_gethostbyname_r" = "yes"; then
1421 AC_MSG_CHECKING([if gethostbyname_r is prototyped])
1422 AC_EGREP_CPP([gethostbyname_r],[
1423 $curl_includes_netdb
1424 ],[
1425 AC_MSG_RESULT([yes])
1426 tst_proto_gethostbyname_r="yes"
1427 ],[
1428 AC_MSG_RESULT([no])
1429 tst_proto_gethostbyname_r="no"
1430 ])
1431 fi
1433 if test "$tst_proto_gethostbyname_r" = "yes"; then
1434 if test "$tst_nargs_gethostbyname_r" = "unknown"; then
1435 AC_MSG_CHECKING([if gethostbyname_r takes 3 args.])
1436 AC_COMPILE_IFELSE([
1437 AC_LANG_PROGRAM([[
1438 $curl_includes_netdb
1439 $curl_includes_bsdsocket
1440 ]],[[
1441 if(gethostbyname_r(0, 0, 0))
1442 return 1;
1443 ]])
1444 ],[
1445 AC_MSG_RESULT([yes])
1446 tst_compi_gethostbyname_r="yes"
1447 tst_nargs_gethostbyname_r="3"
1448 ],[
1449 AC_MSG_RESULT([no])
1450 tst_compi_gethostbyname_r="no"
1451 ])
1452 fi
1453 if test "$tst_nargs_gethostbyname_r" = "unknown"; then
1454 AC_MSG_CHECKING([if gethostbyname_r takes 5 args.])
1455 AC_COMPILE_IFELSE([
1456 AC_LANG_PROGRAM([[
1457 $curl_includes_netdb
1458 $curl_includes_bsdsocket
1459 ]],[[
1460 if(gethostbyname_r(0, 0, 0, 0, 0))
1461 return 1;
1462 ]])
1463 ],[
1464 AC_MSG_RESULT([yes])
1465 tst_compi_gethostbyname_r="yes"
1466 tst_nargs_gethostbyname_r="5"
1467 ],[
1468 AC_MSG_RESULT([no])
1469 tst_compi_gethostbyname_r="no"
1470 ])
1471 fi
1472 if test "$tst_nargs_gethostbyname_r" = "unknown"; then
1473 AC_MSG_CHECKING([if gethostbyname_r takes 6 args.])
1474 AC_COMPILE_IFELSE([
1475 AC_LANG_PROGRAM([[
1476 $curl_includes_netdb
1477 $curl_includes_bsdsocket
1478 ]],[[
1479 if(gethostbyname_r(0, 0, 0, 0, 0, 0))
1480 return 1;
1481 ]])
1482 ],[
1483 AC_MSG_RESULT([yes])
1484 tst_compi_gethostbyname_r="yes"
1485 tst_nargs_gethostbyname_r="6"
1486 ],[
1487 AC_MSG_RESULT([no])
1488 tst_compi_gethostbyname_r="no"
1489 ])
1490 fi
1491 AC_MSG_CHECKING([if gethostbyname_r is compilable])
1492 if test "$tst_compi_gethostbyname_r" = "yes"; then
1493 AC_MSG_RESULT([yes])
1494 else
1495 AC_MSG_RESULT([no])
1496 fi
1497 fi
1499 if test "$tst_compi_gethostbyname_r" = "yes"; then
1500 AC_MSG_CHECKING([if gethostbyname_r usage allowed])
1501 if test "x$curl_disallow_gethostbyname_r" != "xyes"; then
1502 AC_MSG_RESULT([yes])
1503 tst_allow_gethostbyname_r="yes"
1504 else
1505 AC_MSG_RESULT([no])
1506 tst_allow_gethostbyname_r="no"
1507 fi
1508 fi
1510 AC_MSG_CHECKING([if gethostbyname_r might be used])
1511 if test "$tst_links_gethostbyname_r" = "yes" &&
1512 test "$tst_proto_gethostbyname_r" = "yes" &&
1513 test "$tst_compi_gethostbyname_r" = "yes" &&
1514 test "$tst_allow_gethostbyname_r" = "yes"; then
1515 AC_MSG_RESULT([yes])
1516 AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYNAME_R, 1,
1517 [Define to 1 if you have the gethostbyname_r function.])
1518 dnl AC_DEFINE_UNQUOTED(GETHOSTBYNAME_R_ARGS, $tst_nargs_gethostbyname_r,
1519 dnl [Specifies the number of arguments to gethostbyname_r])
1521 if test "$tst_nargs_gethostbyname_r" -eq "3"; then
1522 AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1, [gethostbyname_r() takes 3 args])
1523 elif test "$tst_nargs_gethostbyname_r" -eq "5"; then
1524 AC_DEFINE(HAVE_GETHOSTBYNAME_R_5, 1, [gethostbyname_r() takes 5 args])
1525 elif test "$tst_nargs_gethostbyname_r" -eq "6"; then
1526 AC_DEFINE(HAVE_GETHOSTBYNAME_R_6, 1, [gethostbyname_r() takes 6 args])
1527 fi
1529 curl_cv_func_gethostbyname_r="yes"
1530 else
1531 AC_MSG_RESULT([no])
1532 curl_cv_func_gethostbyname_r="no"
1533 fi
1534])
1537dnl CURL_CHECK_FUNC_GETHOSTNAME
1538dnl -------------------------------------------------
1539dnl Verify if gethostname is available, prototyped, and
1540dnl can be compiled. If all of these are true, and
1541dnl usage has not been previously disallowed with
1542dnl shell variable curl_disallow_gethostname, then
1543dnl HAVE_GETHOSTNAME is defined.
1545AC_DEFUN([CURL_CHECK_FUNC_GETHOSTNAME], [
1546 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])
1547 AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])
1548 AC_REQUIRE([CURL_INCLUDES_UNISTD])
1549 AC_REQUIRE([CURL_PREPROCESS_CALLCONV])
1551 tst_links_gethostname="unknown"
1552 tst_proto_gethostname="unknown"
1553 tst_compi_gethostname="unknown"
1554 tst_allow_gethostname="unknown"
1556 AC_MSG_CHECKING([if gethostname can be linked])
1557 AC_LINK_IFELSE([
1558 AC_LANG_PROGRAM([[
1559 $curl_includes_winsock2
1560 $curl_includes_unistd
1561 $curl_includes_bsdsocket
1562 ]],[[
1563 char s[1];
1564 if(gethostname((void *)s, 0))
1565 return 1;
1566 ]])
1567 ],[
1568 AC_MSG_RESULT([yes])
1569 tst_links_gethostname="yes"
1570 ],[
1571 AC_MSG_RESULT([no])
1572 tst_links_gethostname="no"
1573 ])
1575 if test "$tst_links_gethostname" = "yes"; then
1576 AC_MSG_CHECKING([if gethostname is prototyped])
1577 AC_EGREP_CPP([gethostname],[
1578 $curl_includes_winsock2
1579 $curl_includes_unistd
1580 $curl_includes_bsdsocket
1581 ],[
1582 AC_MSG_RESULT([yes])
1583 tst_proto_gethostname="yes"
1584 ],[
1585 AC_MSG_RESULT([no])
1586 tst_proto_gethostname="no"
1587 ])
1588 fi
1590 if test "$tst_proto_gethostname" = "yes"; then
1591 AC_MSG_CHECKING([if gethostname is compilable])
1592 AC_COMPILE_IFELSE([
1593 AC_LANG_PROGRAM([[
1594 $curl_includes_winsock2
1595 $curl_includes_unistd
1596 $curl_includes_bsdsocket
1597 ]],[[
1598 char s[1];
1599 if(gethostname((void *)s, 0))
1600 return 1;
1601 ]])
1602 ],[
1603 AC_MSG_RESULT([yes])
1604 tst_compi_gethostname="yes"
1605 ],[
1606 AC_MSG_RESULT([no])
1607 tst_compi_gethostname="no"
1608 ])
1609 fi
1611 if test "$tst_compi_gethostname" = "yes"; then
1612 AC_MSG_CHECKING([for gethostname arg 2 data type])
1613 tst_gethostname_type_arg2="unknown"
1614 for tst_arg1 in 'char *' 'unsigned char *' 'void *'; do
1615 for tst_arg2 in 'int' 'unsigned int' 'size_t'; do
1616 if test "$tst_gethostname_type_arg2" = "unknown"; then
1617 AC_COMPILE_IFELSE([
1618 AC_LANG_PROGRAM([[
1619 $curl_includes_winsock2
1620 $curl_includes_unistd
1621 $curl_includes_bsdsocket
1622 $curl_preprocess_callconv
1623 #if defined(_WIN32) && defined(WINSOCK_API_LINKAGE)
1624 WINSOCK_API_LINKAGE
1625 #else
1626 extern
1627 #endif
1628 int FUNCALLCONV gethostname($tst_arg1, $tst_arg2);
1629 ]],[[
1630 char s[1];
1631 if(gethostname(($tst_arg1)s, 0))
1632 return 1;
1633 ]])
1634 ],[
1635 tst_gethostname_type_arg2="$tst_arg2"
1636 ])
1637 fi
1638 done
1639 done
1640 AC_MSG_RESULT([$tst_gethostname_type_arg2])
1641 if test "$tst_gethostname_type_arg2" != "unknown"; then
1642 AC_DEFINE_UNQUOTED(GETHOSTNAME_TYPE_ARG2, $tst_gethostname_type_arg2,
1643 [Define to the type of arg 2 for gethostname.])
1644 fi
1645 fi
1647 if test "$tst_compi_gethostname" = "yes"; then
1648 AC_MSG_CHECKING([if gethostname usage allowed])
1649 if test "x$curl_disallow_gethostname" != "xyes"; then
1650 AC_MSG_RESULT([yes])
1651 tst_allow_gethostname="yes"
1652 else
1653 AC_MSG_RESULT([no])
1654 tst_allow_gethostname="no"
1655 fi
1656 fi
1658 AC_MSG_CHECKING([if gethostname might be used])
1659 if test "$tst_links_gethostname" = "yes" &&
1660 test "$tst_proto_gethostname" = "yes" &&
1661 test "$tst_compi_gethostname" = "yes" &&
1662 test "$tst_allow_gethostname" = "yes"; then
1663 AC_MSG_RESULT([yes])
1664 AC_DEFINE_UNQUOTED(HAVE_GETHOSTNAME, 1,
1665 [Define to 1 if you have the gethostname function.])
1666 curl_cv_func_gethostname="yes"
1667 else
1668 AC_MSG_RESULT([no])
1669 curl_cv_func_gethostname="no"
1670 fi
1671])
1673dnl CURL_CHECK_FUNC_GETPEERNAME
1674dnl -------------------------------------------------
1675dnl Verify if getpeername is available, prototyped, and
1676dnl can be compiled. If all of these are true, and
1677dnl usage has not been previously disallowed with
1678dnl shell variable curl_disallow_getpeername, then
1679dnl HAVE_GETPEERNAME is defined.
1681AC_DEFUN([CURL_CHECK_FUNC_GETPEERNAME], [
1682 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])
1683 AC_REQUIRE([CURL_INCLUDES_UNISTD])
1684 AC_REQUIRE([CURL_PREPROCESS_CALLCONV])
1685 AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])
1687 tst_links_getpeername="unknown"
1688 tst_proto_getpeername="unknown"
1689 tst_compi_getpeername="unknown"
1690 tst_allow_getpeername="unknown"
1692 AC_MSG_CHECKING([if getpeername can be linked])
1693 AC_LINK_IFELSE([
1694 AC_LANG_PROGRAM([[
1695 $curl_includes_winsock2
1696 $curl_includes_bsdsocket
1697 $curl_includes_sys_socket
1698 ]],[[
1699 if(getpeername(0, (void *)0, (void *)0))
1700 return 1;
1701 ]])
1702 ],[
1703 AC_MSG_RESULT([yes])
1704 tst_links_getpeername="yes"
1705 ],[
1706 AC_MSG_RESULT([no])
1707 tst_links_getpeername="no"
1708 ])
1710 if test "$tst_links_getpeername" = "yes"; then
1711 AC_MSG_CHECKING([if getpeername is prototyped])
1712 AC_EGREP_CPP([getpeername],[
1713 $curl_includes_winsock2
1714 $curl_includes_bsdsocket
1715 $curl_includes_sys_socket
1716 ],[
1717 AC_MSG_RESULT([yes])
1718 tst_proto_getpeername="yes"
1719 ],[
1720 AC_MSG_RESULT([no])
1721 tst_proto_getpeername="no"
1722 ])
1723 fi
1725 if test "$tst_proto_getpeername" = "yes"; then
1726 AC_MSG_CHECKING([if getpeername is compilable])
1727 AC_COMPILE_IFELSE([
1728 AC_LANG_PROGRAM([[
1729 $curl_includes_winsock2
1730 $curl_includes_bsdsocket
1731 $curl_includes_sys_socket
1732 ]],[[
1733 if(getpeername(0, (void *)0, (void *)0))
1734 return 1;
1735 ]])
1736 ],[
1737 AC_MSG_RESULT([yes])
1738 tst_compi_getpeername="yes"
1739 ],[
1740 AC_MSG_RESULT([no])
1741 tst_compi_getpeername="no"
1742 ])
1743 fi
1745 if test "$tst_compi_getpeername" = "yes"; then
1746 AC_MSG_CHECKING([if getpeername usage allowed])
1747 if test "x$curl_disallow_getpeername" != "xyes"; then
1748 AC_MSG_RESULT([yes])
1749 tst_allow_getpeername="yes"
1750 else
1751 AC_MSG_RESULT([no])
1752 tst_allow_getpeername="no"
1753 fi
1754 fi
1756 AC_MSG_CHECKING([if getpeername might be used])
1757 if test "$tst_links_getpeername" = "yes" &&
1758 test "$tst_proto_getpeername" = "yes" &&
1759 test "$tst_compi_getpeername" = "yes" &&
1760 test "$tst_allow_getpeername" = "yes"; then
1761 AC_MSG_RESULT([yes])
1762 AC_DEFINE_UNQUOTED(HAVE_GETPEERNAME, 1,
1763 [Define to 1 if you have the getpeername function.])
1764 curl_cv_func_getpeername="yes"
1765 else
1766 AC_MSG_RESULT([no])
1767 curl_cv_func_getpeername="no"
1768 fi
1769])
1771dnl CURL_CHECK_FUNC_GETSOCKNAME
1772dnl -------------------------------------------------
1773dnl Verify if getsockname is available, prototyped, and
1774dnl can be compiled. If all of these are true, and
1775dnl usage has not been previously disallowed with
1776dnl shell variable curl_disallow_getsockname, then
1777dnl HAVE_GETSOCKNAME is defined.
1779AC_DEFUN([CURL_CHECK_FUNC_GETSOCKNAME], [
1780 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])
1781 AC_REQUIRE([CURL_INCLUDES_UNISTD])
1782 AC_REQUIRE([CURL_PREPROCESS_CALLCONV])
1783 AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])
1785 tst_links_getsockname="unknown"
1786 tst_proto_getsockname="unknown"
1787 tst_compi_getsockname="unknown"
1788 tst_allow_getsockname="unknown"
1790 AC_MSG_CHECKING([if getsockname can be linked])
1791 AC_LINK_IFELSE([
1792 AC_LANG_PROGRAM([[
1793 $curl_includes_winsock2
1794 $curl_includes_bsdsocket
1795 $curl_includes_sys_socket
1796 ]],[[
1797 if(getsockname(0, (void *)0, (void *)0))
1798 return 1;
1799 ]])
1800 ],[
1801 AC_MSG_RESULT([yes])
1802 tst_links_getsockname="yes"
1803 ],[
1804 AC_MSG_RESULT([no])
1805 tst_links_getsockname="no"
1806 ])
1808 if test "$tst_links_getsockname" = "yes"; then
1809 AC_MSG_CHECKING([if getsockname is prototyped])
1810 AC_EGREP_CPP([getsockname],[
1811 $curl_includes_winsock2
1812 $curl_includes_bsdsocket
1813 $curl_includes_sys_socket
1814 ],[
1815 AC_MSG_RESULT([yes])
1816 tst_proto_getsockname="yes"
1817 ],[
1818 AC_MSG_RESULT([no])
1819 tst_proto_getsockname="no"
1820 ])
1821 fi
1823 if test "$tst_proto_getsockname" = "yes"; then
1824 AC_MSG_CHECKING([if getsockname is compilable])
1825 AC_COMPILE_IFELSE([
1826 AC_LANG_PROGRAM([[
1827 $curl_includes_winsock2
1828 $curl_includes_bsdsocket
1829 $curl_includes_sys_socket
1830 ]],[[
1831 if(getsockname(0, (void *)0, (void *)0))
1832 return 1;
1833 ]])
1834 ],[
1835 AC_MSG_RESULT([yes])
1836 tst_compi_getsockname="yes"
1837 ],[
1838 AC_MSG_RESULT([no])
1839 tst_compi_getsockname="no"
1840 ])
1841 fi
1843 if test "$tst_compi_getsockname" = "yes"; then
1844 AC_MSG_CHECKING([if getsockname usage allowed])
1845 if test "x$curl_disallow_getsockname" != "xyes"; then
1846 AC_MSG_RESULT([yes])
1847 tst_allow_getsockname="yes"
1848 else
1849 AC_MSG_RESULT([no])
1850 tst_allow_getsockname="no"
1851 fi
1852 fi
1854 AC_MSG_CHECKING([if getsockname might be used])
1855 if test "$tst_links_getsockname" = "yes" &&
1856 test "$tst_proto_getsockname" = "yes" &&
1857 test "$tst_compi_getsockname" = "yes" &&
1858 test "$tst_allow_getsockname" = "yes"; then
1859 AC_MSG_RESULT([yes])
1860 AC_DEFINE_UNQUOTED(HAVE_GETSOCKNAME, 1,
1861 [Define to 1 if you have the getsockname function.])
1862 curl_cv_func_getsockname="yes"
1863 else
1864 AC_MSG_RESULT([no])
1865 curl_cv_func_getsockname="no"
1866 fi
1867])
1870dnl CURL_CHECK_FUNC_GETIFADDRS
1871dnl -------------------------------------------------
1872dnl Verify if getifaddrs is available, prototyped, can
1873dnl be compiled and seems to work. If all of these are
1874dnl true, and usage has not been previously disallowed
1875dnl with shell variable curl_disallow_getifaddrs, then
1876dnl HAVE_GETIFADDRS is defined.
1878AC_DEFUN([CURL_CHECK_FUNC_GETIFADDRS], [
1879 AC_REQUIRE([CURL_INCLUDES_STDLIB])
1880 AC_REQUIRE([CURL_INCLUDES_IFADDRS])
1882 tst_links_getifaddrs="unknown"
1883 tst_proto_getifaddrs="unknown"
1884 tst_compi_getifaddrs="unknown"
1885 tst_works_getifaddrs="unknown"
1886 tst_allow_getifaddrs="unknown"
1888 AC_MSG_CHECKING([if getifaddrs can be linked])
1889 AC_LINK_IFELSE([
1890 AC_LANG_FUNC_LINK_TRY([getifaddrs])
1891 ],[
1892 AC_MSG_RESULT([yes])
1893 tst_links_getifaddrs="yes"
1894 ],[
1895 AC_MSG_RESULT([no])
1896 tst_links_getifaddrs="no"
1897 ])
1899 if test "$tst_links_getifaddrs" = "yes"; then
1900 AC_MSG_CHECKING([if getifaddrs is prototyped])
1901 AC_EGREP_CPP([getifaddrs],[
1902 $curl_includes_ifaddrs
1903 ],[
1904 AC_MSG_RESULT([yes])
1905 tst_proto_getifaddrs="yes"
1906 ],[
1907 AC_MSG_RESULT([no])
1908 tst_proto_getifaddrs="no"
1909 ])
1910 fi
1912 if test "$tst_proto_getifaddrs" = "yes"; then
1913 AC_MSG_CHECKING([if getifaddrs is compilable])
1914 AC_COMPILE_IFELSE([
1915 AC_LANG_PROGRAM([[
1916 $curl_includes_ifaddrs
1917 ]],[[
1918 if(getifaddrs(0))
1919 return 1;
1920 ]])
1921 ],[
1922 AC_MSG_RESULT([yes])
1923 tst_compi_getifaddrs="yes"
1924 ],[
1925 AC_MSG_RESULT([no])
1926 tst_compi_getifaddrs="no"
1927 ])
1928 fi
1930 dnl only do runtime verification when not cross-compiling
1931 if test "$cross_compiling" != "yes" &&
1932 test "$tst_compi_getifaddrs" = "yes"; then
1933 AC_MSG_CHECKING([if getifaddrs seems to work])
1934 CURL_RUN_IFELSE([
1935 AC_LANG_PROGRAM([[
1936 $curl_includes_stdlib
1937 $curl_includes_ifaddrs
1938 ]],[[
1939 struct ifaddrs *ifa = 0;
1940 int error;
1942 error = getifaddrs(&ifa);
1943 if(error || !ifa)
1944 return 1; /* fail */
1945 else {
1946 freeifaddrs(ifa);
1947 return 0;
1948 }
1949 ]])
1950 ],[
1951 AC_MSG_RESULT([yes])
1952 tst_works_getifaddrs="yes"
1953 ],[
1954 AC_MSG_RESULT([no])
1955 tst_works_getifaddrs="no"
1956 ])
1957 fi
1959 if test "$tst_compi_getifaddrs" = "yes" &&
1960 test "$tst_works_getifaddrs" != "no"; then
1961 AC_MSG_CHECKING([if getifaddrs usage allowed])
1962 if test "x$curl_disallow_getifaddrs" != "xyes"; then
1963 AC_MSG_RESULT([yes])
1964 tst_allow_getifaddrs="yes"
1965 else
1966 AC_MSG_RESULT([no])
1967 tst_allow_getifaddrs="no"
1968 fi
1969 fi
1971 AC_MSG_CHECKING([if getifaddrs might be used])
1972 if test "$tst_links_getifaddrs" = "yes" &&
1973 test "$tst_proto_getifaddrs" = "yes" &&
1974 test "$tst_compi_getifaddrs" = "yes" &&
1975 test "$tst_allow_getifaddrs" = "yes" &&
1976 test "$tst_works_getifaddrs" != "no"; then
1977 AC_MSG_RESULT([yes])
1978 AC_DEFINE_UNQUOTED(HAVE_GETIFADDRS, 1,
1979 [Define to 1 if you have a working getifaddrs function.])
1980 curl_cv_func_getifaddrs="yes"
1981 else
1982 AC_MSG_RESULT([no])
1983 curl_cv_func_getifaddrs="no"
1984 fi
1985])
1988dnl CURL_CHECK_FUNC_GMTIME_R
1989dnl -------------------------------------------------
1990dnl Verify if gmtime_r is available, prototyped, can
1991dnl be compiled and seems to work. If all of these are
1992dnl true, and usage has not been previously disallowed
1993dnl with shell variable curl_disallow_gmtime_r, then
1994dnl HAVE_GMTIME_R is defined.
1996AC_DEFUN([CURL_CHECK_FUNC_GMTIME_R], [
1997 AC_REQUIRE([CURL_INCLUDES_STDLIB])
1998 AC_REQUIRE([CURL_INCLUDES_TIME])
2000 tst_links_gmtime_r="unknown"
2001 tst_proto_gmtime_r="unknown"
2002 tst_compi_gmtime_r="unknown"
2003 tst_works_gmtime_r="unknown"
2004 tst_allow_gmtime_r="unknown"
2006 AC_MSG_CHECKING([if gmtime_r can be linked])
2007 AC_LINK_IFELSE([
2008 AC_LANG_FUNC_LINK_TRY([gmtime_r])
2009 ],[
2010 AC_MSG_RESULT([yes])
2011 tst_links_gmtime_r="yes"
2012 ],[
2013 AC_MSG_RESULT([no])
2014 tst_links_gmtime_r="no"
2015 ])
2017 if test "$tst_links_gmtime_r" = "yes"; then
2018 AC_MSG_CHECKING([if gmtime_r is prototyped])
2019 AC_EGREP_CPP([gmtime_r],[
2020 $curl_includes_time
2021 ],[
2022 AC_MSG_RESULT([yes])
2023 tst_proto_gmtime_r="yes"
2024 ],[
2025 AC_MSG_RESULT([no])
2026 tst_proto_gmtime_r="no"
2027 ])
2028 fi
2030 if test "$tst_proto_gmtime_r" = "yes"; then
2031 AC_MSG_CHECKING([if gmtime_r is compilable])
2032 AC_COMPILE_IFELSE([
2033 AC_LANG_PROGRAM([[
2034 $curl_includes_time
2035 ]],[[
2036 time_t tm = 1170352587;
2037 struct tm result;
2038 if(gmtime_r(&tm, &result) == 0)
2039 return 1;
2040 (void)result;
2041 ]])
2042 ],[
2043 AC_MSG_RESULT([yes])
2044 tst_compi_gmtime_r="yes"
2045 ],[
2046 AC_MSG_RESULT([no])
2047 tst_compi_gmtime_r="no"
2048 ])
2049 fi
2051 dnl only do runtime verification when not cross-compiling
2052 if test "$cross_compiling" != "yes" &&
2053 test "$tst_compi_gmtime_r" = "yes"; then
2054 AC_MSG_CHECKING([if gmtime_r seems to work])
2055 CURL_RUN_IFELSE([
2056 AC_LANG_PROGRAM([[
2057 $curl_includes_stdlib
2058 $curl_includes_time
2059 ]],[[
2060 time_t local = 1170352587;
2061 struct tm *gmt = 0;
2062 struct tm result;
2063 gmt = gmtime_r(&local, &result);
2064 (void)result;
2065 if(gmt)
2066 return 0;
2067 else
2068 return 1;
2069 ]])
2070 ],[
2071 AC_MSG_RESULT([yes])
2072 tst_works_gmtime_r="yes"
2073 ],[
2074 AC_MSG_RESULT([no])
2075 tst_works_gmtime_r="no"
2076 ])
2077 fi
2079 if test "$tst_compi_gmtime_r" = "yes" &&
2080 test "$tst_works_gmtime_r" != "no"; then
2081 AC_MSG_CHECKING([if gmtime_r usage allowed])
2082 if test "x$curl_disallow_gmtime_r" != "xyes"; then
2083 AC_MSG_RESULT([yes])
2084 tst_allow_gmtime_r="yes"
2085 else
2086 AC_MSG_RESULT([no])
2087 tst_allow_gmtime_r="no"
2088 fi
2089 fi
2091 AC_MSG_CHECKING([if gmtime_r might be used])
2092 if test "$tst_links_gmtime_r" = "yes" &&
2093 test "$tst_proto_gmtime_r" = "yes" &&
2094 test "$tst_compi_gmtime_r" = "yes" &&
2095 test "$tst_allow_gmtime_r" = "yes" &&
2096 test "$tst_works_gmtime_r" != "no"; then
2097 AC_MSG_RESULT([yes])
2098 AC_DEFINE_UNQUOTED(HAVE_GMTIME_R, 1,
2099 [Define to 1 if you have a working gmtime_r function.])
2100 curl_cv_func_gmtime_r="yes"
2101 else
2102 AC_MSG_RESULT([no])
2103 curl_cv_func_gmtime_r="no"
2104 fi
2105])
2108dnl CURL_CHECK_FUNC_LOCALTIME_R
2109dnl -------------------------------------------------
2110dnl Verify if localtime_r is available, prototyped, can
2111dnl be compiled and seems to work. If all of these are
2112dnl true, and usage has not been previously disallowed
2113dnl with shell variable curl_disallow_localtime_r, then
2114dnl HAVE_LOCALTIME_R is defined.
2116AC_DEFUN([CURL_CHECK_FUNC_LOCALTIME_R], [
2117 AC_REQUIRE([CURL_INCLUDES_STDLIB])
2118 AC_REQUIRE([CURL_INCLUDES_TIME])
2120 tst_links_localtime_r="unknown"
2121 tst_proto_localtime_r="unknown"
2122 tst_compi_localtime_r="unknown"
2123 tst_works_localtime_r="unknown"
2124 tst_allow_localtime_r="unknown"
2126 AC_MSG_CHECKING([if localtime_r can be linked])
2127 AC_LINK_IFELSE([
2128 AC_LANG_FUNC_LINK_TRY([localtime_r])
2129 ],[
2130 AC_MSG_RESULT([yes])
2131 tst_links_localtime_r="yes"
2132 ],[
2133 AC_MSG_RESULT([no])
2134 tst_links_localtime_r="no"
2135 ])
2137 if test "$tst_links_localtime_r" = "yes"; then
2138 AC_MSG_CHECKING([if localtime_r is prototyped])
2139 AC_EGREP_CPP([localtime_r],[
2140 $curl_includes_time
2141 ],[
2142 AC_MSG_RESULT([yes])
2143 tst_proto_localtime_r="yes"
2144 ],[
2145 AC_MSG_RESULT([no])
2146 tst_proto_localtime_r="no"
2147 ])
2148 fi
2150 if test "$tst_proto_localtime_r" = "yes"; then
2151 AC_MSG_CHECKING([if localtime_r is compilable])
2152 AC_COMPILE_IFELSE([
2153 AC_LANG_PROGRAM([[
2154 $curl_includes_time
2155 ]],[[
2156 time_t clock = 1170352587;
2157 struct tm result;
2158 if(localtime_r(&clock, &result))
2159 return 1;
2160 (void)result;
2161 ]])
2162 ],[
2163 AC_MSG_RESULT([yes])
2164 tst_compi_localtime_r="yes"
2165 ],[
2166 AC_MSG_RESULT([no])
2167 tst_compi_localtime_r="no"
2168 ])
2169 fi
2171 dnl only do runtime verification when not cross-compiling
2172 if test "$cross_compiling" != "yes" &&
2173 test "$tst_compi_localtime_r" = "yes"; then
2174 AC_MSG_CHECKING([if localtime_r seems to work])
2175 CURL_RUN_IFELSE([
2176 AC_LANG_PROGRAM([[
2177 $curl_includes_stdlib
2178 $curl_includes_time
2179 ]],[[
2180 time_t clock = 1170352587;
2181 struct tm *tmp = 0;
2182 struct tm result;
2183 tmp = localtime_r(&clock, &result);
2184 (void)result;
2185 if(tmp)
2186 return 0;
2187 else
2188 return 1;
2189 ]])
2190 ],[
2191 AC_MSG_RESULT([yes])
2192 tst_works_localtime_r="yes"
2193 ],[
2194 AC_MSG_RESULT([no])
2195 tst_works_localtime_r="no"
2196 ])
2197 fi
2199 if test "$tst_compi_localtime_r" = "yes" &&
2200 test "$tst_works_localtime_r" != "no"; then
2201 AC_MSG_CHECKING([if localtime_r usage allowed])
2202 if test "x$curl_disallow_localtime_r" != "xyes"; then
2203 AC_MSG_RESULT([yes])
2204 tst_allow_localtime_r="yes"
2205 else
2206 AC_MSG_RESULT([no])
2207 tst_allow_localtime_r="no"
2208 fi
2209 fi
2211 AC_MSG_CHECKING([if localtime_r might be used])
2212 if test "$tst_links_localtime_r" = "yes" &&
2213 test "$tst_proto_localtime_r" = "yes" &&
2214 test "$tst_compi_localtime_r" = "yes" &&
2215 test "$tst_allow_localtime_r" = "yes" &&
2216 test "$tst_works_localtime_r" != "no"; then
2217 AC_MSG_RESULT([yes])
2218 AC_DEFINE_UNQUOTED(HAVE_LOCALTIME_R, 1,
2219 [Define to 1 if you have a working localtime_r function.])
2220 curl_cv_func_localtime_r="yes"
2221 else
2222 AC_MSG_RESULT([no])
2223 curl_cv_func_localtime_r="no"
2224 fi
2225])
2228dnl CURL_CHECK_FUNC_IOCTL
2229dnl -------------------------------------------------
2230dnl Verify if ioctl is available, prototyped, and
2231dnl can be compiled. If all of these are true, and
2232dnl usage has not been previously disallowed with
2233dnl shell variable curl_disallow_ioctl, then
2234dnl curl_cv_func_ioctl is set to "yes".
2236AC_DEFUN([CURL_CHECK_FUNC_IOCTL], [
2237 AC_REQUIRE([CURL_INCLUDES_STROPTS])
2239 tst_links_ioctl="unknown"
2240 tst_proto_ioctl="unknown"
2241 tst_compi_ioctl="unknown"
2242 tst_allow_ioctl="unknown"
2244 AC_MSG_CHECKING([if ioctl can be linked])
2245 AC_LINK_IFELSE([
2246 AC_LANG_FUNC_LINK_TRY([ioctl])
2247 ],[
2248 AC_MSG_RESULT([yes])
2249 tst_links_ioctl="yes"
2250 ],[
2251 AC_MSG_RESULT([no])
2252 tst_links_ioctl="no"
2253 ])
2255 if test "$tst_links_ioctl" = "yes"; then
2256 AC_MSG_CHECKING([if ioctl is prototyped])
2257 AC_EGREP_CPP([ioctl],[
2258 $curl_includes_stropts
2259 ],[
2260 AC_MSG_RESULT([yes])
2261 tst_proto_ioctl="yes"
2262 ],[
2263 AC_MSG_RESULT([no])
2264 tst_proto_ioctl="no"
2265 ])
2266 fi
2268 if test "$tst_proto_ioctl" = "yes"; then
2269 AC_MSG_CHECKING([if ioctl is compilable])
2270 AC_COMPILE_IFELSE([
2271 AC_LANG_PROGRAM([[
2272 $curl_includes_stropts
2273 ]],[[
2274 if(ioctl(0, 0, 0))
2275 return 1;
2276 ]])
2277 ],[
2278 AC_MSG_RESULT([yes])
2279 tst_compi_ioctl="yes"
2280 ],[
2281 AC_MSG_RESULT([no])
2282 tst_compi_ioctl="no"
2283 ])
2284 fi
2286 if test "$tst_compi_ioctl" = "yes"; then
2287 AC_MSG_CHECKING([if ioctl usage allowed])
2288 if test "x$curl_disallow_ioctl" != "xyes"; then
2289 AC_MSG_RESULT([yes])
2290 tst_allow_ioctl="yes"
2291 else
2292 AC_MSG_RESULT([no])
2293 tst_allow_ioctl="no"
2294 fi
2295 fi
2297 AC_MSG_CHECKING([if ioctl might be used])
2298 if test "$tst_links_ioctl" = "yes" &&
2299 test "$tst_proto_ioctl" = "yes" &&
2300 test "$tst_compi_ioctl" = "yes" &&
2301 test "$tst_allow_ioctl" = "yes"; then
2302 AC_MSG_RESULT([yes])
2303 curl_cv_func_ioctl="yes"
2304 CURL_CHECK_FUNC_IOCTL_FIONBIO
2305 CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR
2306 else
2307 AC_MSG_RESULT([no])
2308 curl_cv_func_ioctl="no"
2309 fi
2310])
2313dnl CURL_CHECK_FUNC_IOCTL_FIONBIO
2314dnl -------------------------------------------------
2315dnl Verify if ioctl with the FIONBIO command is
2316dnl available, can be compiled, and seems to work. If
2317dnl all of these are true, then HAVE_IOCTL_FIONBIO
2318dnl is defined.
2320AC_DEFUN([CURL_CHECK_FUNC_IOCTL_FIONBIO], [
2322 tst_compi_ioctl_fionbio="unknown"
2323 tst_allow_ioctl_fionbio="unknown"
2325 if test "$curl_cv_func_ioctl" = "yes"; then
2326 AC_MSG_CHECKING([if ioctl FIONBIO is compilable])
2327 AC_COMPILE_IFELSE([
2328 AC_LANG_PROGRAM([[
2329 $curl_includes_stropts
2330 ]],[[
2331 int flags = 0;
2332 if(ioctl(0, FIONBIO, &flags))
2333 return 1;
2334 ]])
2335 ],[
2336 AC_MSG_RESULT([yes])
2337 tst_compi_ioctl_fionbio="yes"
2338 ],[
2339 AC_MSG_RESULT([no])
2340 tst_compi_ioctl_fionbio="no"
2341 ])
2342 fi
2344 if test "$tst_compi_ioctl_fionbio" = "yes"; then
2345 AC_MSG_CHECKING([if ioctl FIONBIO usage allowed])
2346 if test "x$curl_disallow_ioctl_fionbio" != "xyes"; then
2347 AC_MSG_RESULT([yes])
2348 tst_allow_ioctl_fionbio="yes"
2349 else
2350 AC_MSG_RESULT([no])
2351 tst_allow_ioctl_fionbio="no"
2352 fi
2353 fi
2355 AC_MSG_CHECKING([if ioctl FIONBIO might be used])
2356 if test "$tst_compi_ioctl_fionbio" = "yes" &&
2357 test "$tst_allow_ioctl_fionbio" = "yes"; then
2358 AC_MSG_RESULT([yes])
2359 AC_DEFINE_UNQUOTED(HAVE_IOCTL_FIONBIO, 1,
2360 [Define to 1 if you have a working ioctl FIONBIO function.])
2361 curl_cv_func_ioctl_fionbio="yes"
2362 else
2363 AC_MSG_RESULT([no])
2364 curl_cv_func_ioctl_fionbio="no"
2365 fi
2366])
2369dnl CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR
2370dnl -------------------------------------------------
2371dnl Verify if ioctl with the SIOCGIFADDR command is available,
2372dnl struct ifreq is defined, they can be compiled, and seem to
2373dnl work. If all of these are true, then HAVE_IOCTL_SIOCGIFADDR
2374dnl is defined.
2376AC_DEFUN([CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR], [
2378 tst_compi_ioctl_siocgifaddr="unknown"
2379 tst_allow_ioctl_siocgifaddr="unknown"
2381 if test "$curl_cv_func_ioctl" = "yes"; then
2382 AC_MSG_CHECKING([if ioctl SIOCGIFADDR is compilable])
2383 AC_COMPILE_IFELSE([
2384 AC_LANG_PROGRAM([[
2385 $curl_includes_stropts
2386 #include <net/if.h>
2387 ]],[[
2388 struct ifreq ifr;
2389 if(ioctl(0, SIOCGIFADDR, &ifr))
2390 return 1;
2391 ]])
2392 ],[
2393 AC_MSG_RESULT([yes])
2394 tst_compi_ioctl_siocgifaddr="yes"
2395 ],[
2396 AC_MSG_RESULT([no])
2397 tst_compi_ioctl_siocgifaddr="no"
2398 ])
2399 fi
2401 if test "$tst_compi_ioctl_siocgifaddr" = "yes"; then
2402 AC_MSG_CHECKING([if ioctl SIOCGIFADDR usage allowed])
2403 if test "x$curl_disallow_ioctl_siocgifaddr" != "xyes"; then
2404 AC_MSG_RESULT([yes])
2405 tst_allow_ioctl_siocgifaddr="yes"
2406 else
2407 AC_MSG_RESULT([no])
2408 tst_allow_ioctl_siocgifaddr="no"
2409 fi
2410 fi
2412 AC_MSG_CHECKING([if ioctl SIOCGIFADDR might be used])
2413 if test "$tst_compi_ioctl_siocgifaddr" = "yes" &&
2414 test "$tst_allow_ioctl_siocgifaddr" = "yes"; then
2415 AC_MSG_RESULT([yes])
2416 AC_DEFINE_UNQUOTED(HAVE_IOCTL_SIOCGIFADDR, 1,
2417 [Define to 1 if you have a working ioctl SIOCGIFADDR function.])
2418 curl_cv_func_ioctl_siocgifaddr="yes"
2419 else
2420 AC_MSG_RESULT([no])
2421 curl_cv_func_ioctl_siocgifaddr="no"
2422 fi
2423])
2426dnl CURL_CHECK_FUNC_IOCTLSOCKET
2427dnl -------------------------------------------------
2428dnl Verify if ioctlsocket is available, prototyped, and
2429dnl can be compiled. If all of these are true, and
2430dnl usage has not been previously disallowed with
2431dnl shell variable curl_disallow_ioctlsocket, then
2432dnl HAVE_IOCTLSOCKET is defined.
2434AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET], [
2435 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])
2437 tst_links_ioctlsocket="unknown"
2438 tst_proto_ioctlsocket="unknown"
2439 tst_compi_ioctlsocket="unknown"
2440 tst_allow_ioctlsocket="unknown"
2442 AC_MSG_CHECKING([if ioctlsocket can be linked])
2443 AC_LINK_IFELSE([
2444 AC_LANG_PROGRAM([[
2445 $curl_includes_winsock2
2446 ]],[[
2447 if(ioctlsocket(0, 0, 0))
2448 return 1;
2449 ]])
2450 ],[
2451 AC_MSG_RESULT([yes])
2452 tst_links_ioctlsocket="yes"
2453 ],[
2454 AC_MSG_RESULT([no])
2455 tst_links_ioctlsocket="no"
2456 ])
2458 if test "$tst_links_ioctlsocket" = "yes"; then
2459 AC_MSG_CHECKING([if ioctlsocket is prototyped])
2460 AC_EGREP_CPP([ioctlsocket],[
2461 $curl_includes_winsock2
2462 ],[
2463 AC_MSG_RESULT([yes])
2464 tst_proto_ioctlsocket="yes"
2465 ],[
2466 AC_MSG_RESULT([no])
2467 tst_proto_ioctlsocket="no"
2468 ])
2469 fi
2471 if test "$tst_proto_ioctlsocket" = "yes"; then
2472 AC_MSG_CHECKING([if ioctlsocket is compilable])
2473 AC_COMPILE_IFELSE([
2474 AC_LANG_PROGRAM([[
2475 $curl_includes_winsock2
2476 ]],[[
2477 if(ioctlsocket(0, 0, 0))
2478 return 1;
2479 ]])
2480 ],[
2481 AC_MSG_RESULT([yes])
2482 tst_compi_ioctlsocket="yes"
2483 ],[
2484 AC_MSG_RESULT([no])
2485 tst_compi_ioctlsocket="no"
2486 ])
2487 fi
2489 if test "$tst_compi_ioctlsocket" = "yes"; then
2490 AC_MSG_CHECKING([if ioctlsocket usage allowed])
2491 if test "x$curl_disallow_ioctlsocket" != "xyes"; then
2492 AC_MSG_RESULT([yes])
2493 tst_allow_ioctlsocket="yes"
2494 else
2495 AC_MSG_RESULT([no])
2496 tst_allow_ioctlsocket="no"
2497 fi
2498 fi
2500 AC_MSG_CHECKING([if ioctlsocket might be used])
2501 if test "$tst_links_ioctlsocket" = "yes" &&
2502 test "$tst_proto_ioctlsocket" = "yes" &&
2503 test "$tst_compi_ioctlsocket" = "yes" &&
2504 test "$tst_allow_ioctlsocket" = "yes"; then
2505 AC_MSG_RESULT([yes])
2506 AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET, 1,
2507 [Define to 1 if you have the ioctlsocket function.])
2508 curl_cv_func_ioctlsocket="yes"
2509 CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO
2510 else
2511 AC_MSG_RESULT([no])
2512 curl_cv_func_ioctlsocket="no"
2513 fi
2514])
2517dnl CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO
2518dnl -------------------------------------------------
2519dnl Verify if ioctlsocket with the FIONBIO command is
2520dnl available, can be compiled, and seems to work. If
2521dnl all of these are true, then HAVE_IOCTLSOCKET_FIONBIO
2522dnl is defined.
2524AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO], [
2526 tst_compi_ioctlsocket_fionbio="unknown"
2527 tst_allow_ioctlsocket_fionbio="unknown"
2529 if test "$curl_cv_func_ioctlsocket" = "yes"; then
2530 AC_MSG_CHECKING([if ioctlsocket FIONBIO is compilable])
2531 AC_COMPILE_IFELSE([
2532 AC_LANG_PROGRAM([[
2533 $curl_includes_winsock2
2534 ]],[[
2535 unsigned long flags = 0;
2536 if(ioctlsocket(0, FIONBIO, &flags))
2537 return 1;
2538 ]])
2539 ],[
2540 AC_MSG_RESULT([yes])
2541 tst_compi_ioctlsocket_fionbio="yes"
2542 ],[
2543 AC_MSG_RESULT([no])
2544 tst_compi_ioctlsocket_fionbio="no"
2545 ])
2546 fi
2548 if test "$tst_compi_ioctlsocket_fionbio" = "yes"; then
2549 AC_MSG_CHECKING([if ioctlsocket FIONBIO usage allowed])
2550 if test "x$curl_disallow_ioctlsocket_fionbio" != "xyes"; then
2551 AC_MSG_RESULT([yes])
2552 tst_allow_ioctlsocket_fionbio="yes"
2553 else
2554 AC_MSG_RESULT([no])
2555 tst_allow_ioctlsocket_fionbio="no"
2556 fi
2557 fi
2559 AC_MSG_CHECKING([if ioctlsocket FIONBIO might be used])
2560 if test "$tst_compi_ioctlsocket_fionbio" = "yes" &&
2561 test "$tst_allow_ioctlsocket_fionbio" = "yes"; then
2562 AC_MSG_RESULT([yes])
2563 AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_FIONBIO, 1,
2564 [Define to 1 if you have a working ioctlsocket FIONBIO function.])
2565 curl_cv_func_ioctlsocket_fionbio="yes"
2566 else
2567 AC_MSG_RESULT([no])
2568 curl_cv_func_ioctlsocket_fionbio="no"
2569 fi
2570])
2573dnl CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
2574dnl -------------------------------------------------
2575dnl Verify if IoctlSocket is available, prototyped, and
2576dnl can be compiled. If all of these are true, and
2577dnl usage has not been previously disallowed with
2578dnl shell variable curl_disallow_ioctlsocket_camel,
2579dnl then HAVE_IOCTLSOCKET_CAMEL is defined.
2581AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL], [
2582 AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])
2584 tst_links_ioctlsocket_camel="unknown"
2585 tst_compi_ioctlsocket_camel="unknown"
2586 tst_allow_ioctlsocket_camel="unknown"
2588 AC_MSG_CHECKING([if IoctlSocket can be linked])
2589 AC_LINK_IFELSE([
2590 AC_LANG_PROGRAM([[
2591 $curl_includes_bsdsocket
2592 ]],[[
2593 if(IoctlSocket(0, 0, 0))
2594 return 1;
2595 ]])
2596 ],[
2597 AC_MSG_RESULT([yes])
2598 tst_links_ioctlsocket_camel="yes"
2599 ],[
2600 AC_MSG_RESULT([no])
2601 tst_links_ioctlsocket_camel="no"
2602 ])
2604 if test "$tst_links_ioctlsocket_camel" = "yes"; then
2605 AC_MSG_CHECKING([if IoctlSocket is compilable])
2606 AC_COMPILE_IFELSE([
2607 AC_LANG_PROGRAM([[
2608 $curl_includes_bsdsocket
2609 ]],[[
2610 if(IoctlSocket(0, 0, 0))
2611 return 1;
2612 ]])
2613 ],[
2614 AC_MSG_RESULT([yes])
2615 tst_compi_ioctlsocket_camel="yes"
2616 ],[
2617 AC_MSG_RESULT([no])
2618 tst_compi_ioctlsocket_camel="no"
2619 ])
2620 fi
2622 if test "$tst_compi_ioctlsocket_camel" = "yes"; then
2623 AC_MSG_CHECKING([if IoctlSocket usage allowed])
2624 if test "x$curl_disallow_ioctlsocket_camel" != "xyes"; then
2625 AC_MSG_RESULT([yes])
2626 tst_allow_ioctlsocket_camel="yes"
2627 else
2628 AC_MSG_RESULT([no])
2629 tst_allow_ioctlsocket_camel="no"
2630 fi
2631 fi
2633 AC_MSG_CHECKING([if IoctlSocket might be used])
2634 if test "$tst_links_ioctlsocket_camel" = "yes" &&
2635 test "$tst_compi_ioctlsocket_camel" = "yes" &&
2636 test "$tst_allow_ioctlsocket_camel" = "yes"; then
2637 AC_MSG_RESULT([yes])
2638 AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_CAMEL, 1,
2639 [Define to 1 if you have the IoctlSocket camel case function.])
2640 curl_cv_func_ioctlsocket_camel="yes"
2641 CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO
2642 else
2643 AC_MSG_RESULT([no])
2644 curl_cv_func_ioctlsocket_camel="no"
2645 fi
2646])
2649dnl CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO
2650dnl -------------------------------------------------
2651dnl Verify if IoctlSocket with FIONBIO command is available,
2652dnl can be compiled, and seems to work. If all of these are
2653dnl true, then HAVE_IOCTLSOCKET_CAMEL_FIONBIO is defined.
2655AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO], [
2656 AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])
2658 tst_compi_ioctlsocket_camel_fionbio="unknown"
2659 tst_allow_ioctlsocket_camel_fionbio="unknown"
2661 if test "$curl_cv_func_ioctlsocket_camel" = "yes"; then
2662 AC_MSG_CHECKING([if IoctlSocket FIONBIO is compilable])
2663 AC_COMPILE_IFELSE([
2664 AC_LANG_PROGRAM([[
2665 $curl_includes_bsdsocket
2666 ]],[[
2667 long flags = 0;
2668 if(IoctlSocket(0, FIONBIO, &flags))
2669 return 1;
2670 ]])
2671 ],[
2672 AC_MSG_RESULT([yes])
2673 tst_compi_ioctlsocket_camel_fionbio="yes"
2674 ],[
2675 AC_MSG_RESULT([no])
2676 tst_compi_ioctlsocket_camel_fionbio="no"
2677 ])
2678 fi
2680 if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes"; then
2681 AC_MSG_CHECKING([if IoctlSocket FIONBIO usage allowed])
2682 if test "x$curl_disallow_ioctlsocket_camel_fionbio" != "xyes"; then
2683 AC_MSG_RESULT([yes])
2684 tst_allow_ioctlsocket_camel_fionbio="yes"
2685 else
2686 AC_MSG_RESULT([no])
2687 tst_allow_ioctlsocket_camel_fionbio="no"
2688 fi
2689 fi
2691 AC_MSG_CHECKING([if IoctlSocket FIONBIO might be used])
2692 if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes" &&
2693 test "$tst_allow_ioctlsocket_camel_fionbio" = "yes"; then
2694 AC_MSG_RESULT([yes])
2695 AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_CAMEL_FIONBIO, 1,
2696 [Define to 1 if you have a working IoctlSocket camel case FIONBIO function.])
2697 curl_cv_func_ioctlsocket_camel_fionbio="yes"
2698 else
2699 AC_MSG_RESULT([no])
2700 curl_cv_func_ioctlsocket_camel_fionbio="no"
2701 fi
2702])
2705dnl CURL_CHECK_FUNC_MEMRCHR
2706dnl -------------------------------------------------
2707dnl Verify if memrchr is available, prototyped, and
2708dnl can be compiled. If all of these are true, and
2709dnl usage has not been previously disallowed with
2710dnl shell variable curl_disallow_memrchr, then
2711dnl HAVE_MEMRCHR is defined.
2713AC_DEFUN([CURL_CHECK_FUNC_MEMRCHR], [
2714 AC_REQUIRE([CURL_INCLUDES_STRING])
2716 tst_links_memrchr="unknown"
2717 tst_macro_memrchr="unknown"
2718 tst_proto_memrchr="unknown"
2719 tst_compi_memrchr="unknown"
2720 tst_allow_memrchr="unknown"
2722 AC_MSG_CHECKING([if memrchr can be linked])
2723 AC_LINK_IFELSE([
2724 AC_LANG_FUNC_LINK_TRY([memrchr])
2725 ],[
2726 AC_MSG_RESULT([yes])
2727 tst_links_memrchr="yes"
2728 ],[
2729 AC_MSG_RESULT([no])
2730 tst_links_memrchr="no"
2731 ])
2733 if test "$tst_links_memrchr" = "no"; then
2734 AC_MSG_CHECKING([if memrchr seems a macro])
2735 AC_LINK_IFELSE([
2736 AC_LANG_PROGRAM([[
2737 $curl_includes_string
2738 ]],[[
2739 if(memrchr("", 0, 0))
2740 return 1;
2741 ]])
2742 ],[
2743 AC_MSG_RESULT([yes])
2744 tst_macro_memrchr="yes"
2745 ],[
2746 AC_MSG_RESULT([no])
2747 tst_macro_memrchr="no"
2748 ])
2749 fi
2751 if test "$tst_links_memrchr" = "yes"; then
2752 AC_MSG_CHECKING([if memrchr is prototyped])
2753 AC_EGREP_CPP([memrchr],[
2754 $curl_includes_string
2755 ],[
2756 AC_MSG_RESULT([yes])
2757 tst_proto_memrchr="yes"
2758 ],[
2759 AC_MSG_RESULT([no])
2760 tst_proto_memrchr="no"
2761 ])
2762 fi
2764 if test "$tst_proto_memrchr" = "yes" ||
2765 test "$tst_macro_memrchr" = "yes"; then
2766 AC_MSG_CHECKING([if memrchr is compilable])
2767 AC_COMPILE_IFELSE([
2768 AC_LANG_PROGRAM([[
2769 $curl_includes_string
2770 ]],[[
2771 if(memrchr("", 0, 0))
2772 return 1;
2773 ]])
2774 ],[
2775 AC_MSG_RESULT([yes])
2776 tst_compi_memrchr="yes"
2777 ],[
2778 AC_MSG_RESULT([no])
2779 tst_compi_memrchr="no"
2780 ])
2781 fi
2783 if test "$tst_compi_memrchr" = "yes"; then
2784 AC_MSG_CHECKING([if memrchr usage allowed])
2785 if test "x$curl_disallow_memrchr" != "xyes"; then
2786 AC_MSG_RESULT([yes])
2787 tst_allow_memrchr="yes"
2788 else
2789 AC_MSG_RESULT([no])
2790 tst_allow_memrchr="no"
2791 fi
2792 fi
2794 AC_MSG_CHECKING([if memrchr might be used])
2795 if (test "$tst_proto_memrchr" = "yes" ||
2796 test "$tst_macro_memrchr" = "yes") &&
2797 test "$tst_compi_memrchr" = "yes" &&
2798 test "$tst_allow_memrchr" = "yes"; then
2799 AC_MSG_RESULT([yes])
2800 AC_DEFINE_UNQUOTED(HAVE_MEMRCHR, 1,
2801 [Define to 1 if you have the memrchr function or macro.])
2802 curl_cv_func_memrchr="yes"
2803 else
2804 AC_MSG_RESULT([no])
2805 curl_cv_func_memrchr="no"
2806 fi
2807])
2810dnl CURL_CHECK_FUNC_SIGACTION
2811dnl -------------------------------------------------
2812dnl Verify if sigaction is available, prototyped, and
2813dnl can be compiled. If all of these are true, and
2814dnl usage has not been previously disallowed with
2815dnl shell variable curl_disallow_sigaction, then
2816dnl HAVE_SIGACTION is defined.
2818AC_DEFUN([CURL_CHECK_FUNC_SIGACTION], [
2819 AC_REQUIRE([CURL_INCLUDES_SIGNAL])
2821 tst_links_sigaction="unknown"
2822 tst_proto_sigaction="unknown"
2823 tst_compi_sigaction="unknown"
2824 tst_allow_sigaction="unknown"
2826 AC_MSG_CHECKING([if sigaction can be linked])
2827 AC_LINK_IFELSE([
2828 AC_LANG_FUNC_LINK_TRY([sigaction])
2829 ],[
2830 AC_MSG_RESULT([yes])
2831 tst_links_sigaction="yes"
2832 ],[
2833 AC_MSG_RESULT([no])
2834 tst_links_sigaction="no"
2835 ])
2837 if test "$tst_links_sigaction" = "yes"; then
2838 AC_MSG_CHECKING([if sigaction is prototyped])
2839 AC_EGREP_CPP([sigaction],[
2840 $curl_includes_signal
2841 ],[
2842 AC_MSG_RESULT([yes])
2843 tst_proto_sigaction="yes"
2844 ],[
2845 AC_MSG_RESULT([no])
2846 tst_proto_sigaction="no"
2847 ])
2848 fi
2850 if test "$tst_proto_sigaction" = "yes"; then
2851 AC_MSG_CHECKING([if sigaction is compilable])
2852 AC_COMPILE_IFELSE([
2853 AC_LANG_PROGRAM([[
2854 $curl_includes_signal
2855 ]],[[
2856 if(sigaction(0, 0, 0))
2857 return 1;
2858 ]])
2859 ],[
2860 AC_MSG_RESULT([yes])
2861 tst_compi_sigaction="yes"
2862 ],[
2863 AC_MSG_RESULT([no])
2864 tst_compi_sigaction="no"
2865 ])
2866 fi
2868 if test "$tst_compi_sigaction" = "yes"; then
2869 AC_MSG_CHECKING([if sigaction usage allowed])
2870 if test "x$curl_disallow_sigaction" != "xyes"; then
2871 AC_MSG_RESULT([yes])
2872 tst_allow_sigaction="yes"
2873 else
2874 AC_MSG_RESULT([no])
2875 tst_allow_sigaction="no"
2876 fi
2877 fi
2879 AC_MSG_CHECKING([if sigaction might be used])
2880 if test "$tst_links_sigaction" = "yes" &&
2881 test "$tst_proto_sigaction" = "yes" &&
2882 test "$tst_compi_sigaction" = "yes" &&
2883 test "$tst_allow_sigaction" = "yes"; then
2884 AC_MSG_RESULT([yes])
2885 AC_DEFINE_UNQUOTED(HAVE_SIGACTION, 1,
2886 [Define to 1 if you have the sigaction function.])
2887 curl_cv_func_sigaction="yes"
2888 else
2889 AC_MSG_RESULT([no])
2890 curl_cv_func_sigaction="no"
2891 fi
2892])
2895dnl CURL_CHECK_FUNC_SIGINTERRUPT
2896dnl -------------------------------------------------
2897dnl Verify if siginterrupt is available, prototyped, and
2898dnl can be compiled. If all of these are true, and
2899dnl usage has not been previously disallowed with
2900dnl shell variable curl_disallow_siginterrupt, then
2901dnl HAVE_SIGINTERRUPT is defined.
2903AC_DEFUN([CURL_CHECK_FUNC_SIGINTERRUPT], [
2904 AC_REQUIRE([CURL_INCLUDES_SIGNAL])
2906 tst_links_siginterrupt="unknown"
2907 tst_proto_siginterrupt="unknown"
2908 tst_compi_siginterrupt="unknown"
2909 tst_allow_siginterrupt="unknown"
2911 AC_MSG_CHECKING([if siginterrupt can be linked])
2912 AC_LINK_IFELSE([
2913 AC_LANG_FUNC_LINK_TRY([siginterrupt])
2914 ],[
2915 AC_MSG_RESULT([yes])
2916 tst_links_siginterrupt="yes"
2917 ],[
2918 AC_MSG_RESULT([no])
2919 tst_links_siginterrupt="no"
2920 ])
2922 if test "$tst_links_siginterrupt" = "yes"; then
2923 AC_MSG_CHECKING([if siginterrupt is prototyped])
2924 AC_EGREP_CPP([siginterrupt],[
2925 $curl_includes_signal
2926 ],[
2927 AC_MSG_RESULT([yes])
2928 tst_proto_siginterrupt="yes"
2929 ],[
2930 AC_MSG_RESULT([no])
2931 tst_proto_siginterrupt="no"
2932 ])
2933 fi
2935 if test "$tst_proto_siginterrupt" = "yes"; then
2936 AC_MSG_CHECKING([if siginterrupt is compilable])
2937 AC_COMPILE_IFELSE([
2938 AC_LANG_PROGRAM([[
2939 $curl_includes_signal
2940 ]],[[
2941 if(siginterrupt(0, 0))
2942 return 1;
2943 ]])
2944 ],[
2945 AC_MSG_RESULT([yes])
2946 tst_compi_siginterrupt="yes"
2947 ],[
2948 AC_MSG_RESULT([no])
2949 tst_compi_siginterrupt="no"
2950 ])
2951 fi
2953 if test "$tst_compi_siginterrupt" = "yes"; then
2954 AC_MSG_CHECKING([if siginterrupt usage allowed])
2955 if test "x$curl_disallow_siginterrupt" != "xyes"; then
2956 AC_MSG_RESULT([yes])
2957 tst_allow_siginterrupt="yes"
2958 else
2959 AC_MSG_RESULT([no])
2960 tst_allow_siginterrupt="no"
2961 fi
2962 fi
2964 AC_MSG_CHECKING([if siginterrupt might be used])
2965 if test "$tst_links_siginterrupt" = "yes" &&
2966 test "$tst_proto_siginterrupt" = "yes" &&
2967 test "$tst_compi_siginterrupt" = "yes" &&
2968 test "$tst_allow_siginterrupt" = "yes"; then
2969 AC_MSG_RESULT([yes])
2970 AC_DEFINE_UNQUOTED(HAVE_SIGINTERRUPT, 1,
2971 [Define to 1 if you have the siginterrupt function.])
2972 curl_cv_func_siginterrupt="yes"
2973 else
2974 AC_MSG_RESULT([no])
2975 curl_cv_func_siginterrupt="no"
2976 fi
2977])
2980dnl CURL_CHECK_FUNC_SIGNAL
2981dnl -------------------------------------------------
2982dnl Verify if signal is available, prototyped, and
2983dnl can be compiled. If all of these are true, and
2984dnl usage has not been previously disallowed with
2985dnl shell variable curl_disallow_signal, then
2986dnl HAVE_SIGNAL is defined.
2988AC_DEFUN([CURL_CHECK_FUNC_SIGNAL], [
2989 AC_REQUIRE([CURL_INCLUDES_SIGNAL])
2991 tst_links_signal="unknown"
2992 tst_proto_signal="unknown"
2993 tst_compi_signal="unknown"
2994 tst_allow_signal="unknown"
2996 AC_MSG_CHECKING([if signal can be linked])
2997 AC_LINK_IFELSE([
2998 AC_LANG_FUNC_LINK_TRY([signal])
2999 ],[
3000 AC_MSG_RESULT([yes])
3001 tst_links_signal="yes"
3002 ],[
3003 AC_MSG_RESULT([no])
3004 tst_links_signal="no"
3005 ])
3007 if test "$tst_links_signal" = "yes"; then
3008 AC_MSG_CHECKING([if signal is prototyped])
3009 AC_EGREP_CPP([signal],[
3010 $curl_includes_signal
3011 ],[
3012 AC_MSG_RESULT([yes])
3013 tst_proto_signal="yes"
3014 ],[
3015 AC_MSG_RESULT([no])
3016 tst_proto_signal="no"
3017 ])
3018 fi
3020 if test "$tst_proto_signal" = "yes"; then
3021 AC_MSG_CHECKING([if signal is compilable])
3022 AC_COMPILE_IFELSE([
3023 AC_LANG_PROGRAM([[
3024 $curl_includes_signal
3025 ]],[[
3026 if(signal(0, 0))
3027 return 1;
3028 ]])
3029 ],[
3030 AC_MSG_RESULT([yes])
3031 tst_compi_signal="yes"
3032 ],[
3033 AC_MSG_RESULT([no])
3034 tst_compi_signal="no"
3035 ])
3036 fi
3038 if test "$tst_compi_signal" = "yes"; then
3039 AC_MSG_CHECKING([if signal usage allowed])
3040 if test "x$curl_disallow_signal" != "xyes"; then
3041 AC_MSG_RESULT([yes])
3042 tst_allow_signal="yes"
3043 else
3044 AC_MSG_RESULT([no])
3045 tst_allow_signal="no"
3046 fi
3047 fi
3049 AC_MSG_CHECKING([if signal might be used])
3050 if test "$tst_links_signal" = "yes" &&
3051 test "$tst_proto_signal" = "yes" &&
3052 test "$tst_compi_signal" = "yes" &&
3053 test "$tst_allow_signal" = "yes"; then
3054 AC_MSG_RESULT([yes])
3055 AC_DEFINE_UNQUOTED(HAVE_SIGNAL, 1,
3056 [Define to 1 if you have the signal function.])
3057 curl_cv_func_signal="yes"
3058 else
3059 AC_MSG_RESULT([no])
3060 curl_cv_func_signal="no"
3061 fi
3062])
3065dnl CURL_CHECK_FUNC_SIGSETJMP
3066dnl -------------------------------------------------
3067dnl Verify if sigsetjmp is available, prototyped, and
3068dnl can be compiled. If all of these are true, and
3069dnl usage has not been previously disallowed with
3070dnl shell variable curl_disallow_sigsetjmp, then
3071dnl HAVE_SIGSETJMP is defined.
3073AC_DEFUN([CURL_CHECK_FUNC_SIGSETJMP], [
3074 AC_REQUIRE([CURL_INCLUDES_SETJMP])
3076 tst_links_sigsetjmp="unknown"
3077 tst_macro_sigsetjmp="unknown"
3078 tst_proto_sigsetjmp="unknown"
3079 tst_compi_sigsetjmp="unknown"
3080 tst_allow_sigsetjmp="unknown"
3082 AC_MSG_CHECKING([if sigsetjmp can be linked])
3083 AC_LINK_IFELSE([
3084 AC_LANG_FUNC_LINK_TRY([sigsetjmp])
3085 ],[
3086 AC_MSG_RESULT([yes])
3087 tst_links_sigsetjmp="yes"
3088 ],[
3089 AC_MSG_RESULT([no])
3090 tst_links_sigsetjmp="no"
3091 ])
3093 if test "$tst_links_sigsetjmp" = "no"; then
3094 AC_MSG_CHECKING([if sigsetjmp seems a macro])
3095 AC_LINK_IFELSE([
3096 AC_LANG_PROGRAM([[
3097 $curl_includes_setjmp
3098 ]],[[
3099 sigjmp_buf env;
3100 if(sigsetjmp(env, 0))
3101 return 1;
3102 ]])
3103 ],[
3104 AC_MSG_RESULT([yes])
3105 tst_macro_sigsetjmp="yes"
3106 ],[
3107 AC_MSG_RESULT([no])
3108 tst_macro_sigsetjmp="no"
3109 ])
3110 fi
3112 if test "$tst_links_sigsetjmp" = "yes"; then
3113 AC_MSG_CHECKING([if sigsetjmp is prototyped])
3114 AC_EGREP_CPP([sigsetjmp],[
3115 $curl_includes_setjmp
3116 ],[
3117 AC_MSG_RESULT([yes])
3118 tst_proto_sigsetjmp="yes"
3119 ],[
3120 AC_MSG_RESULT([no])
3121 tst_proto_sigsetjmp="no"
3122 ])
3123 fi
3125 if test "$tst_proto_sigsetjmp" = "yes" ||
3126 test "$tst_macro_sigsetjmp" = "yes"; then
3127 AC_MSG_CHECKING([if sigsetjmp is compilable])
3128 AC_COMPILE_IFELSE([
3129 AC_LANG_PROGRAM([[
3130 $curl_includes_setjmp
3131 ]],[[
3132 sigjmp_buf env;
3133 if(sigsetjmp(env, 0))
3134 return 1;
3135 ]])
3136 ],[
3137 AC_MSG_RESULT([yes])
3138 tst_compi_sigsetjmp="yes"
3139 ],[
3140 AC_MSG_RESULT([no])
3141 tst_compi_sigsetjmp="no"
3142 ])
3143 fi
3145 if test "$tst_compi_sigsetjmp" = "yes"; then
3146 AC_MSG_CHECKING([if sigsetjmp usage allowed])
3147 if test "x$curl_disallow_sigsetjmp" != "xyes"; then
3148 AC_MSG_RESULT([yes])
3149 tst_allow_sigsetjmp="yes"
3150 else
3151 AC_MSG_RESULT([no])
3152 tst_allow_sigsetjmp="no"
3153 fi
3154 fi
3156 AC_MSG_CHECKING([if sigsetjmp might be used])
3157 if (test "$tst_proto_sigsetjmp" = "yes" ||
3158 test "$tst_macro_sigsetjmp" = "yes") &&
3159 test "$tst_compi_sigsetjmp" = "yes" &&
3160 test "$tst_allow_sigsetjmp" = "yes"; then
3161 AC_MSG_RESULT([yes])
3162 AC_DEFINE_UNQUOTED(HAVE_SIGSETJMP, 1,
3163 [Define to 1 if you have the sigsetjmp function or macro.])
3164 curl_cv_func_sigsetjmp="yes"
3165 else
3166 AC_MSG_RESULT([no])
3167 curl_cv_func_sigsetjmp="no"
3168 fi
3169])
3172dnl CURL_CHECK_FUNC_SOCKET
3173dnl -------------------------------------------------
3174dnl Verify if socket is available, prototyped, and
3175dnl can be compiled. If all of these are true, and
3176dnl usage has not been previously disallowed with
3177dnl shell variable curl_disallow_socket, then
3178dnl HAVE_SOCKET is defined.
3180AC_DEFUN([CURL_CHECK_FUNC_SOCKET], [
3181 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])
3182 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])
3184 tst_links_socket="unknown"
3185 tst_proto_socket="unknown"
3186 tst_compi_socket="unknown"
3187 tst_allow_socket="unknown"
3189 AC_MSG_CHECKING([if socket can be linked])
3190 AC_LINK_IFELSE([
3191 AC_LANG_PROGRAM([[
3192 $curl_includes_winsock2
3193 $curl_includes_bsdsocket
3194 $curl_includes_sys_socket
3195 ]],[[
3196 if(socket(0, 0, 0))
3197 return 1;
3198 ]])
3199 ],[
3200 AC_MSG_RESULT([yes])
3201 tst_links_socket="yes"
3202 ],[
3203 AC_MSG_RESULT([no])
3204 tst_links_socket="no"
3205 ])
3207 if test "$tst_links_socket" = "yes"; then
3208 AC_MSG_CHECKING([if socket is prototyped])
3209 AC_EGREP_CPP([socket],[
3210 $curl_includes_winsock2
3211 $curl_includes_bsdsocket
3212 $curl_includes_sys_socket
3213 ],[
3214 AC_MSG_RESULT([yes])
3215 tst_proto_socket="yes"
3216 ],[
3217 AC_MSG_RESULT([no])
3218 tst_proto_socket="no"
3219 ])
3220 fi
3222 if test "$tst_proto_socket" = "yes"; then
3223 AC_MSG_CHECKING([if socket is compilable])
3224 AC_COMPILE_IFELSE([
3225 AC_LANG_PROGRAM([[
3226 $curl_includes_winsock2
3227 $curl_includes_bsdsocket
3228 $curl_includes_sys_socket
3229 ]],[[
3230 if(socket(0, 0, 0))
3231 return 1;
3232 ]])
3233 ],[
3234 AC_MSG_RESULT([yes])
3235 tst_compi_socket="yes"
3236 ],[
3237 AC_MSG_RESULT([no])
3238 tst_compi_socket="no"
3239 ])
3240 fi
3242 if test "$tst_compi_socket" = "yes"; then
3243 AC_MSG_CHECKING([if socket usage allowed])
3244 if test "x$curl_disallow_socket" != "xyes"; then
3245 AC_MSG_RESULT([yes])
3246 tst_allow_socket="yes"
3247 else
3248 AC_MSG_RESULT([no])
3249 tst_allow_socket="no"
3250 fi
3251 fi
3253 AC_MSG_CHECKING([if socket might be used])
3254 if test "$tst_links_socket" = "yes" &&
3255 test "$tst_proto_socket" = "yes" &&
3256 test "$tst_compi_socket" = "yes" &&
3257 test "$tst_allow_socket" = "yes"; then
3258 AC_MSG_RESULT([yes])
3259 AC_DEFINE_UNQUOTED(HAVE_SOCKET, 1,
3260 [Define to 1 if you have the socket function.])
3261 curl_cv_func_socket="yes"
3262 else
3263 AC_MSG_RESULT([no])
3264 curl_cv_func_socket="no"
3265 fi
3266])
3269dnl CURL_CHECK_FUNC_SOCKETPAIR
3270dnl -------------------------------------------------
3271dnl Verify if socketpair is available, prototyped, and
3272dnl can be compiled. If all of these are true, and
3273dnl usage has not been previously disallowed with
3274dnl shell variable curl_disallow_socketpair, then
3275dnl HAVE_SOCKETPAIR is defined.
3277AC_DEFUN([CURL_CHECK_FUNC_SOCKETPAIR], [
3278 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])
3280 tst_links_socketpair="unknown"
3281 tst_proto_socketpair="unknown"
3282 tst_compi_socketpair="unknown"
3283 tst_allow_socketpair="unknown"
3285 AC_MSG_CHECKING([if socketpair can be linked])
3286 AC_LINK_IFELSE([
3287 AC_LANG_FUNC_LINK_TRY([socketpair])
3288 ],[
3289 AC_MSG_RESULT([yes])
3290 tst_links_socketpair="yes"
3291 ],[
3292 AC_MSG_RESULT([no])
3293 tst_links_socketpair="no"
3294 ])
3296 if test "$tst_links_socketpair" = "yes"; then
3297 AC_MSG_CHECKING([if socketpair is prototyped])
3298 AC_EGREP_CPP([socketpair],[
3299 $curl_includes_sys_socket
3300 ],[
3301 AC_MSG_RESULT([yes])
3302 tst_proto_socketpair="yes"
3303 ],[
3304 AC_MSG_RESULT([no])
3305 tst_proto_socketpair="no"
3306 ])
3307 fi
3309 if test "$tst_proto_socketpair" = "yes"; then
3310 AC_MSG_CHECKING([if socketpair is compilable])
3311 AC_COMPILE_IFELSE([
3312 AC_LANG_PROGRAM([[
3313 $curl_includes_sys_socket
3314 ]],[[
3315 int sv[2];
3316 if(socketpair(0, 0, 0, sv))
3317 return 1;
3318 ]])
3319 ],[
3320 AC_MSG_RESULT([yes])
3321 tst_compi_socketpair="yes"
3322 ],[
3323 AC_MSG_RESULT([no])
3324 tst_compi_socketpair="no"
3325 ])
3326 fi
3328 if test "$tst_compi_socketpair" = "yes"; then
3329 AC_MSG_CHECKING([if socketpair usage allowed])
3330 if test "x$curl_disallow_socketpair" != "xyes"; then
3331 AC_MSG_RESULT([yes])
3332 tst_allow_socketpair="yes"
3333 else
3334 AC_MSG_RESULT([no])
3335 tst_allow_socketpair="no"
3336 fi
3337 fi
3339 AC_MSG_CHECKING([if socketpair might be used])
3340 if test "$tst_links_socketpair" = "yes" &&
3341 test "$tst_proto_socketpair" = "yes" &&
3342 test "$tst_compi_socketpair" = "yes" &&
3343 test "$tst_allow_socketpair" = "yes"; then
3344 AC_MSG_RESULT([yes])
3345 AC_DEFINE_UNQUOTED(HAVE_SOCKETPAIR, 1,
3346 [Define to 1 if you have the socketpair function.])
3347 curl_cv_func_socketpair="yes"
3348 else
3349 AC_MSG_RESULT([no])
3350 curl_cv_func_socketpair="no"
3351 fi
3352])
3355dnl CURL_CHECK_FUNC_STRCASECMP
3356dnl -------------------------------------------------
3357dnl Verify if strcasecmp is available, prototyped, and
3358dnl can be compiled. If all of these are true, and
3359dnl usage has not been previously disallowed with
3360dnl shell variable curl_disallow_strcasecmp, then
3361dnl HAVE_STRCASECMP is defined.
3363AC_DEFUN([CURL_CHECK_FUNC_STRCASECMP], [
3364 AC_REQUIRE([CURL_INCLUDES_STRING])
3366 tst_links_strcasecmp="unknown"
3367 tst_proto_strcasecmp="unknown"
3368 tst_compi_strcasecmp="unknown"
3369 tst_allow_strcasecmp="unknown"
3371 AC_MSG_CHECKING([if strcasecmp can be linked])
3372 AC_LINK_IFELSE([
3373 AC_LANG_FUNC_LINK_TRY([strcasecmp])
3374 ],[
3375 AC_MSG_RESULT([yes])
3376 tst_links_strcasecmp="yes"
3377 ],[
3378 AC_MSG_RESULT([no])
3379 tst_links_strcasecmp="no"
3380 ])
3382 if test "$tst_links_strcasecmp" = "yes"; then
3383 AC_MSG_CHECKING([if strcasecmp is prototyped])
3384 AC_EGREP_CPP([strcasecmp],[
3385 $curl_includes_string
3386 ],[
3387 AC_MSG_RESULT([yes])
3388 tst_proto_strcasecmp="yes"
3389 ],[
3390 AC_MSG_RESULT([no])
3391 tst_proto_strcasecmp="no"
3392 ])
3393 fi
3395 if test "$tst_proto_strcasecmp" = "yes"; then
3396 AC_MSG_CHECKING([if strcasecmp is compilable])
3397 AC_COMPILE_IFELSE([
3398 AC_LANG_PROGRAM([[
3399 $curl_includes_string
3400 ]],[[
3401 if(strcasecmp("", ""))
3402 return 1;
3403 ]])
3404 ],[
3405 AC_MSG_RESULT([yes])
3406 tst_compi_strcasecmp="yes"
3407 ],[
3408 AC_MSG_RESULT([no])
3409 tst_compi_strcasecmp="no"
3410 ])
3411 fi
3413 if test "$tst_compi_strcasecmp" = "yes"; then
3414 AC_MSG_CHECKING([if strcasecmp usage allowed])
3415 if test "x$curl_disallow_strcasecmp" != "xyes"; then
3416 AC_MSG_RESULT([yes])
3417 tst_allow_strcasecmp="yes"
3418 else
3419 AC_MSG_RESULT([no])
3420 tst_allow_strcasecmp="no"
3421 fi
3422 fi
3424 AC_MSG_CHECKING([if strcasecmp might be used])
3425 if test "$tst_links_strcasecmp" = "yes" &&
3426 test "$tst_proto_strcasecmp" = "yes" &&
3427 test "$tst_compi_strcasecmp" = "yes" &&
3428 test "$tst_allow_strcasecmp" = "yes"; then
3429 AC_MSG_RESULT([yes])
3430 AC_DEFINE_UNQUOTED(HAVE_STRCASECMP, 1,
3431 [Define to 1 if you have the strcasecmp function.])
3432 curl_cv_func_strcasecmp="yes"
3433 else
3434 AC_MSG_RESULT([no])
3435 curl_cv_func_strcasecmp="no"
3436 fi
3437])
3439dnl CURL_CHECK_FUNC_STRCMPI
3440dnl -------------------------------------------------
3441dnl Verify if strcmpi is available, prototyped, and
3442dnl can be compiled. If all of these are true, and
3443dnl usage has not been previously disallowed with
3444dnl shell variable curl_disallow_strcmpi, then
3445dnl HAVE_STRCMPI is defined.
3447AC_DEFUN([CURL_CHECK_FUNC_STRCMPI], [
3448 AC_REQUIRE([CURL_INCLUDES_STRING])
3450 tst_links_strcmpi="unknown"
3451 tst_proto_strcmpi="unknown"
3452 tst_compi_strcmpi="unknown"
3453 tst_allow_strcmpi="unknown"
3455 AC_MSG_CHECKING([if strcmpi can be linked])
3456 AC_LINK_IFELSE([
3457 AC_LANG_FUNC_LINK_TRY([strcmpi])
3458 ],[
3459 AC_MSG_RESULT([yes])
3460 tst_links_strcmpi="yes"
3461 ],[
3462 AC_MSG_RESULT([no])
3463 tst_links_strcmpi="no"
3464 ])
3466 if test "$tst_links_strcmpi" = "yes"; then
3467 AC_MSG_CHECKING([if strcmpi is prototyped])
3468 AC_EGREP_CPP([strcmpi],[
3469 $curl_includes_string
3470 ],[
3471 AC_MSG_RESULT([yes])
3472 tst_proto_strcmpi="yes"
3473 ],[
3474 AC_MSG_RESULT([no])
3475 tst_proto_strcmpi="no"
3476 ])
3477 fi
3479 if test "$tst_proto_strcmpi" = "yes"; then
3480 AC_MSG_CHECKING([if strcmpi is compilable])
3481 AC_COMPILE_IFELSE([
3482 AC_LANG_PROGRAM([[
3483 $curl_includes_string
3484 ]],[[
3485 if(strcmpi(0, 0))
3486 return 1;
3487 ]])
3488 ],[
3489 AC_MSG_RESULT([yes])
3490 tst_compi_strcmpi="yes"
3491 ],[
3492 AC_MSG_RESULT([no])
3493 tst_compi_strcmpi="no"
3494 ])
3495 fi
3497 if test "$tst_compi_strcmpi" = "yes"; then
3498 AC_MSG_CHECKING([if strcmpi usage allowed])
3499 if test "x$curl_disallow_strcmpi" != "xyes"; then
3500 AC_MSG_RESULT([yes])
3501 tst_allow_strcmpi="yes"
3502 else
3503 AC_MSG_RESULT([no])
3504 tst_allow_strcmpi="no"
3505 fi
3506 fi
3508 AC_MSG_CHECKING([if strcmpi might be used])
3509 if test "$tst_links_strcmpi" = "yes" &&
3510 test "$tst_proto_strcmpi" = "yes" &&
3511 test "$tst_compi_strcmpi" = "yes" &&
3512 test "$tst_allow_strcmpi" = "yes"; then
3513 AC_MSG_RESULT([yes])
3514 AC_DEFINE_UNQUOTED(HAVE_STRCMPI, 1,
3515 [Define to 1 if you have the strcmpi function.])
3516 curl_cv_func_strcmpi="yes"
3517 else
3518 AC_MSG_RESULT([no])
3519 curl_cv_func_strcmpi="no"
3520 fi
3521])
3524dnl CURL_CHECK_FUNC_STRERROR_R
3525dnl -------------------------------------------------
3526dnl Verify if strerror_r is available, prototyped, can be compiled and
3527dnl seems to work. If all of these are true, and usage has not been
3528dnl previously disallowed with shell variable curl_disallow_strerror_r,
3529dnl then HAVE_STRERROR_R is defined, as well as one of
3530dnl HAVE_GLIBC_STRERROR_R or HAVE_POSIX_STRERROR_R.
3531dnl
3532dnl glibc-style strerror_r:
3533dnl
3534dnl char *strerror_r(int errnum, char *workbuf, size_t bufsize);
3535dnl
3536dnl glibc-style strerror_r returns a pointer to the error string,
3537dnl and might use the provided workbuf as a scratch area if needed. A
3538dnl quick test on a few systems shows that it is usually not used at all.
3539dnl
3540dnl POSIX-style strerror_r:
3541dnl
3542dnl int strerror_r(int errnum, char *resultbuf, size_t bufsize);
3543dnl
3544dnl POSIX-style strerror_r returns 0 upon successful completion and the
3545dnl error string in the provided resultbuf.
3546dnl
3548AC_DEFUN([CURL_CHECK_FUNC_STRERROR_R], [
3549 AC_REQUIRE([CURL_INCLUDES_STDLIB])
3550 AC_REQUIRE([CURL_INCLUDES_STRING])
3552 tst_links_strerror_r="unknown"
3553 tst_proto_strerror_r="unknown"
3554 tst_compi_strerror_r="unknown"
3555 tst_glibc_strerror_r="unknown"
3556 tst_posix_strerror_r="unknown"
3557 tst_allow_strerror_r="unknown"
3558 tst_works_glibc_strerror_r="unknown"
3559 tst_works_posix_strerror_r="unknown"
3560 tst_glibc_strerror_r_type_arg3="unknown"
3561 tst_posix_strerror_r_type_arg3="unknown"
3563 AC_MSG_CHECKING([if strerror_r can be linked])
3564 AC_LINK_IFELSE([
3565 AC_LANG_FUNC_LINK_TRY([strerror_r])
3566 ],[
3567 AC_MSG_RESULT([yes])
3568 tst_links_strerror_r="yes"
3569 ],[
3570 AC_MSG_RESULT([no])
3571 tst_links_strerror_r="no"
3572 ])
3574 if test "$tst_links_strerror_r" = "yes"; then
3575 AC_MSG_CHECKING([if strerror_r is prototyped])
3576 AC_EGREP_CPP([strerror_r],[
3577 $curl_includes_string
3578 ],[
3579 AC_MSG_RESULT([yes])
3580 tst_proto_strerror_r="yes"
3581 ],[
3582 AC_MSG_RESULT([no])
3583 tst_proto_strerror_r="no"
3584 ])
3585 fi
3587 if test "$tst_proto_strerror_r" = "yes"; then
3588 AC_MSG_CHECKING([if strerror_r is compilable])
3589 AC_COMPILE_IFELSE([
3590 AC_LANG_PROGRAM([[
3591 $curl_includes_string
3592 ]],[[
3593 char s[1];
3594 if(strerror_r(0, s, 0))
3595 return 1;
3596 ]])
3597 ],[
3598 AC_MSG_RESULT([yes])
3599 tst_compi_strerror_r="yes"
3600 ],[
3601 AC_MSG_RESULT([no])
3602 tst_compi_strerror_r="no"
3603 ])
3604 fi
3606 if test "$tst_compi_strerror_r" = "yes"; then
3607 AC_MSG_CHECKING([if strerror_r is glibc like])
3608 tst_glibc_strerror_r_type_arg3="unknown"
3609 for arg3 in 'size_t' 'int' 'unsigned int'; do
3610 if test "$tst_glibc_strerror_r_type_arg3" = "unknown"; then
3611 AC_COMPILE_IFELSE([
3612 AC_LANG_PROGRAM([[
3613 $curl_includes_string
3614 char *strerror_r(int errnum, char *workbuf, $arg3 bufsize);
3615 ]],[[
3616 char s[1];
3617 if(strerror_r(0, s, 0))
3618 return 1;
3619 (void)s;
3620 ]])
3621 ],[
3622 tst_glibc_strerror_r_type_arg3="$arg3"
3623 ])
3624 fi
3625 done
3626 case "$tst_glibc_strerror_r_type_arg3" in
3627 unknown)
3628 AC_MSG_RESULT([no])
3629 tst_glibc_strerror_r="no"
3630 ;;
3631 *)
3632 AC_MSG_RESULT([yes])
3633 tst_glibc_strerror_r="yes"
3634 ;;
3635 esac
3636 fi
3638 dnl only do runtime verification when not cross-compiling
3639 if test "$cross_compiling" != "yes" &&
3640 test "$tst_glibc_strerror_r" = "yes"; then
3641 AC_MSG_CHECKING([if strerror_r seems to work])
3642 CURL_RUN_IFELSE([
3643 AC_LANG_PROGRAM([[
3644 $curl_includes_stdlib
3645 $curl_includes_string
3646 #include <errno.h>
3647 ]],[[
3648 char buffer[1024];
3649 char *string = 0;
3650 buffer[0] = '\0';
3651 string = strerror_r(EACCES, buffer, sizeof(buffer));
3652 if(!string)
3653 return 1; /* fail */
3654 if(!string[0])
3655 return 1; /* fail */
3656 else
3657 return 0;
3658 ]])
3659 ],[
3660 AC_MSG_RESULT([yes])
3661 tst_works_glibc_strerror_r="yes"
3662 ],[
3663 AC_MSG_RESULT([no])
3664 tst_works_glibc_strerror_r="no"
3665 ])
3666 fi
3668 if test "$tst_compi_strerror_r" = "yes" &&
3669 test "$tst_works_glibc_strerror_r" != "yes"; then
3670 AC_MSG_CHECKING([if strerror_r is POSIX like])
3671 tst_posix_strerror_r_type_arg3="unknown"
3672 for arg3 in 'size_t' 'int' 'unsigned int'; do
3673 if test "$tst_posix_strerror_r_type_arg3" = "unknown"; then
3674 AC_COMPILE_IFELSE([
3675 AC_LANG_PROGRAM([[
3676 $curl_includes_string
3677 int strerror_r(int errnum, char *resultbuf, $arg3 bufsize);
3678 ]],[[
3679 char s[1];
3680 if(strerror_r(0, s, 0))
3681 return 1;
3682 (void)s;
3683 ]])
3684 ],[
3685 tst_posix_strerror_r_type_arg3="$arg3"
3686 ])
3687 fi
3688 done
3689 case "$tst_posix_strerror_r_type_arg3" in
3690 unknown)
3691 AC_MSG_RESULT([no])
3692 tst_posix_strerror_r="no"
3693 ;;
3694 *)
3695 AC_MSG_RESULT([yes])
3696 tst_posix_strerror_r="yes"
3697 ;;
3698 esac
3699 fi
3701 dnl only do runtime verification when not cross-compiling
3702 if test "$cross_compiling" != "yes" &&
3703 test "$tst_posix_strerror_r" = "yes"; then
3704 AC_MSG_CHECKING([if strerror_r seems to work])
3705 CURL_RUN_IFELSE([
3706 AC_LANG_PROGRAM([[
3707 $curl_includes_stdlib
3708 $curl_includes_string
3709 #include <errno.h>
3710 ]],[[
3711 char buffer[1024];
3712 int error = 1;
3713 buffer[0] = '\0';
3714 error = strerror_r(EACCES, buffer, sizeof(buffer));
3715 if(error)
3716 return 1; /* fail */
3717 if(buffer[0] == '\0')
3718 return 1; /* fail */
3719 else
3720 return 0;
3721 ]])
3722 ],[
3723 AC_MSG_RESULT([yes])
3724 tst_works_posix_strerror_r="yes"
3725 ],[
3726 AC_MSG_RESULT([no])
3727 tst_works_posix_strerror_r="no"
3728 ])
3729 fi
3731 if test "$tst_works_glibc_strerror_r" = "yes"; then
3732 tst_posix_strerror_r="no"
3733 fi
3734 if test "$tst_works_posix_strerror_r" = "yes"; then
3735 tst_glibc_strerror_r="no"
3736 fi
3737 if test "$tst_glibc_strerror_r" = "yes" &&
3738 test "$tst_works_glibc_strerror_r" != "no" &&
3739 test "$tst_posix_strerror_r" != "yes"; then
3740 tst_allow_strerror_r="check"
3741 fi
3742 if test "$tst_posix_strerror_r" = "yes" &&
3743 test "$tst_works_posix_strerror_r" != "no" &&
3744 test "$tst_glibc_strerror_r" != "yes"; then
3745 tst_allow_strerror_r="check"
3746 fi
3747 if test "$tst_allow_strerror_r" = "check"; then
3748 AC_MSG_CHECKING([if strerror_r usage allowed])
3749 if test "x$curl_disallow_strerror_r" != "xyes"; then
3750 AC_MSG_RESULT([yes])
3751 tst_allow_strerror_r="yes"
3752 else
3753 AC_MSG_RESULT([no])
3754 tst_allow_strerror_r="no"
3755 fi
3756 fi
3758 AC_MSG_CHECKING([if strerror_r might be used])
3759 if test "$tst_links_strerror_r" = "yes" &&
3760 test "$tst_proto_strerror_r" = "yes" &&
3761 test "$tst_compi_strerror_r" = "yes" &&
3762 test "$tst_allow_strerror_r" = "yes"; then
3763 AC_MSG_RESULT([yes])
3764 if test "$tst_glibc_strerror_r" = "yes"; then
3765 AC_DEFINE_UNQUOTED(HAVE_STRERROR_R, 1,
3766 [Define to 1 if you have the strerror_r function.])
3767 AC_DEFINE_UNQUOTED(HAVE_GLIBC_STRERROR_R, 1,
3768 [Define to 1 if you have a working glibc-style strerror_r function.])
3769 fi
3770 if test "$tst_posix_strerror_r" = "yes"; then
3771 AC_DEFINE_UNQUOTED(HAVE_STRERROR_R, 1,
3772 [Define to 1 if you have the strerror_r function.])
3773 AC_DEFINE_UNQUOTED(HAVE_POSIX_STRERROR_R, 1,
3774 [Define to 1 if you have a working POSIX-style strerror_r function.])
3775 fi
3776 curl_cv_func_strerror_r="yes"
3777 else
3778 AC_MSG_RESULT([no])
3779 curl_cv_func_strerror_r="no"
3780 fi
3782 if test "$tst_compi_strerror_r" = "yes" &&
3783 test "$tst_allow_strerror_r" = "unknown"; then
3784 AC_MSG_WARN([cannot determine strerror_r() style: edit lib/curl_config.h manually.])
3785 fi
3786])
3789dnl CURL_CHECK_FUNC_STRICMP
3790dnl -------------------------------------------------
3791dnl Verify if stricmp is available, prototyped, and
3792dnl can be compiled. If all of these are true, and
3793dnl usage has not been previously disallowed with
3794dnl shell variable curl_disallow_stricmp, then
3795dnl HAVE_STRICMP is defined.
3797AC_DEFUN([CURL_CHECK_FUNC_STRICMP], [
3798 AC_REQUIRE([CURL_INCLUDES_STRING])
3800 tst_links_stricmp="unknown"
3801 tst_proto_stricmp="unknown"
3802 tst_compi_stricmp="unknown"
3803 tst_allow_stricmp="unknown"
3805 AC_MSG_CHECKING([if stricmp can be linked])
3806 AC_LINK_IFELSE([
3807 AC_LANG_FUNC_LINK_TRY([stricmp])
3808 ],[
3809 AC_MSG_RESULT([yes])
3810 tst_links_stricmp="yes"
3811 ],[
3812 AC_MSG_RESULT([no])
3813 tst_links_stricmp="no"
3814 ])
3816 if test "$tst_links_stricmp" = "yes"; then
3817 AC_MSG_CHECKING([if stricmp is prototyped])
3818 AC_EGREP_CPP([stricmp],[
3819 $curl_includes_string
3820 ],[
3821 AC_MSG_RESULT([yes])
3822 tst_proto_stricmp="yes"
3823 ],[
3824 AC_MSG_RESULT([no])
3825 tst_proto_stricmp="no"
3826 ])
3827 fi
3829 if test "$tst_proto_stricmp" = "yes"; then
3830 AC_MSG_CHECKING([if stricmp is compilable])
3831 AC_COMPILE_IFELSE([
3832 AC_LANG_PROGRAM([[
3833 $curl_includes_string
3834 ]],[[
3835 if(stricmp(0, 0))
3836 return 1;
3837 ]])
3838 ],[
3839 AC_MSG_RESULT([yes])
3840 tst_compi_stricmp="yes"
3841 ],[
3842 AC_MSG_RESULT([no])
3843 tst_compi_stricmp="no"
3844 ])
3845 fi
3847 if test "$tst_compi_stricmp" = "yes"; then
3848 AC_MSG_CHECKING([if stricmp usage allowed])
3849 if test "x$curl_disallow_stricmp" != "xyes"; then
3850 AC_MSG_RESULT([yes])
3851 tst_allow_stricmp="yes"
3852 else
3853 AC_MSG_RESULT([no])
3854 tst_allow_stricmp="no"
3855 fi
3856 fi
3858 AC_MSG_CHECKING([if stricmp might be used])
3859 if test "$tst_links_stricmp" = "yes" &&
3860 test "$tst_proto_stricmp" = "yes" &&
3861 test "$tst_compi_stricmp" = "yes" &&
3862 test "$tst_allow_stricmp" = "yes"; then
3863 AC_MSG_RESULT([yes])
3864 AC_DEFINE_UNQUOTED(HAVE_STRICMP, 1,
3865 [Define to 1 if you have the stricmp function.])
3866 curl_cv_func_stricmp="yes"
3867 else
3868 AC_MSG_RESULT([no])
3869 curl_cv_func_stricmp="no"
3870 fi
3871])
3874dnl CURL_CHECK_FUNC_MEMSET_S
3875dnl -------------------------------------------------
3876dnl Verify if memset_s is available, prototyped, and
3877dnl can be compiled. If all of these are true, and
3878dnl usage has not been previously disallowed with
3879dnl shell variable curl_disallow_memset_s, then
3880dnl HAVE_MEMSET_S is defined.
3882AC_DEFUN([CURL_CHECK_FUNC_MEMSET_S], [
3883 AC_REQUIRE([CURL_INCLUDES_STRING])
3885 tst_links_memset_s="unknown"
3886 tst_proto_memset_s="unknown"
3887 tst_compi_memset_s="unknown"
3888 tst_allow_memset_s="unknown"
3890 AC_MSG_CHECKING([if memset_s can be linked])
3891 AC_LINK_IFELSE([
3892 AC_LANG_FUNC_LINK_TRY([memset_s])
3893 ],[
3894 AC_MSG_RESULT([yes])
3895 tst_links_memset_s="yes"
3896 ],[
3897 AC_MSG_RESULT([no])
3898 tst_links_memset_s="no"
3899 ])
3901 if test "$tst_links_memset_s" = "yes"; then
3902 AC_MSG_CHECKING([if memset_s is prototyped])
3903 AC_EGREP_CPP([memset_s],[
3904 $curl_includes_string
3905 ],[
3906 AC_MSG_RESULT([yes])
3907 tst_proto_memset_s="yes"
3908 ],[
3909 AC_MSG_RESULT([no])
3910 tst_proto_memset_s="no"
3911 ])
3912 fi
3914 if test "$tst_proto_memset_s" = "yes"; then
3915 AC_MSG_CHECKING([if memset_s is compilable])
3916 AC_COMPILE_IFELSE([
3917 AC_LANG_PROGRAM([[
3918 $curl_includes_string
3919 ]],[[
3920 char buf[2];
3921 if(memset_s(buf, sizeof(buf), 0, sizeof(buf)))
3922 return 1;
3923 ]])
3924 ],[
3925 AC_MSG_RESULT([yes])
3926 tst_compi_memset_s="yes"
3927 ],[
3928 AC_MSG_RESULT([no])
3929 tst_compi_memset_s="no"
3930 ])
3931 fi
3933 if test "$tst_compi_memset_s" = "yes"; then
3934 AC_MSG_CHECKING([if memset_s usage allowed])
3935 if test "x$curl_disallow_memset_s" != "xyes"; then
3936 AC_MSG_RESULT([yes])
3937 tst_allow_memset_s="yes"
3938 else
3939 AC_MSG_RESULT([no])
3940 tst_allow_memset_s="no"
3941 fi
3942 fi
3944 AC_MSG_CHECKING([if memset_s might be used])
3945 if test "$tst_links_memset_s" = "yes" &&
3946 test "$tst_proto_memset_s" = "yes" &&
3947 test "$tst_compi_memset_s" = "yes" &&
3948 test "$tst_allow_memset_s" = "yes"; then
3949 AC_MSG_RESULT([yes])
3950 AC_DEFINE_UNQUOTED(HAVE_MEMSET_S, 1,
3951 [Define to 1 if you have the memset_s function.])
3952 curl_cv_func_memset_s="yes"
3953 else
3954 AC_MSG_RESULT([no])
3955 curl_cv_func_memset_s="no"
3956 fi
3957])
3959dnl CURL_RUN_IFELSE
3960dnl -------------------------------------------------
3961dnl Wrapper macro to use instead of AC_RUN_IFELSE. It
3962dnl sets LD_LIBRARY_PATH locally for this run only, from the
3963dnl CURL_LIBRARY_PATH variable. It keeps the LD_LIBRARY_PATH
3964dnl changes contained within this macro.
3966AC_DEFUN([CURL_RUN_IFELSE], [
3967 if test "$curl_cv_apple" = "yes"; then
3968 AC_RUN_IFELSE([AC_LANG_SOURCE([$1])], $2, $3, $4)
3969 else
3970 oldcc=$CC
3971 old=$LD_LIBRARY_PATH
3972 CC="sh ./run-compiler"
3973 LD_LIBRARY_PATH=$CURL_LIBRARY_PATH:$old
3974 export LD_LIBRARY_PATH
3975 AC_RUN_IFELSE([AC_LANG_SOURCE([$1])], $2, $3, $4)
3976 # restore
3977 LD_LIBRARY_PATH=$old
3978 CC=$oldcc
3979 fi
3980])
3982dnl CURL_COVERAGE
3983dnl --------------------------------------------------
3984dnl Switch on options and libs to build with gcc's code coverage.
3985dnl
3987AC_DEFUN([CURL_COVERAGE],[
3988 AC_REQUIRE([AC_PROG_SED])
3989 AC_REQUIRE([AC_ARG_ENABLE])
3990 AC_MSG_CHECKING([for code coverage support])
3991 coverage="no"
3992 curl_coverage_msg="disabled"
3994 dnl check if enabled by argument
3995 AC_ARG_ENABLE(code-coverage,
3996 AS_HELP_STRING([--enable-code-coverage], [Provide code coverage]),
3997 coverage="$enableval")
3999 dnl if not gcc or clang switch off again
4000 AS_IF([test "$compiler_id" != "GNU_C" && test "$compiler_id" != "CLANG" && test "$compiler_id" != "APPLECLANG"], coverage="no" )
Diagnostics4 git calls · 36 ms
CallStatusSizeTime036 ms
discover200152 B3 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=3 git.response.bytes=152 git.server.agent=gitty/1.0 git.server.object_format=sha1 git.server.caps=agent ls-refs fetch object-format git.server.fetch=shallow filter sideband-all git.protocol.version=2 git.pkt.frames=8 git.pkt.data=6 git.pkt.flush=2 git.pkt.delim=0 git.pkt.bytes=152 git.pkt.payload.max=34
ls-refs200149 B · hit3 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=3 git.response.bytes=149 git.response.cache=HIT git.response.duration_ms=3 git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=149 git.pkt.payload.max=78 git.ls_refs.count=2 git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit8 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=24 git.response.bytes=293470 git.response.cache=HIT git.response.duration_ms=8 git.fetch.filter=blob:none git.fetch.filter.requested=tree:0 git.fetch.filter.fallback=blob:none git.fetch.filter.learned=false git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d git.fetch.haves.count=0 git.fetch.deepen=10 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=10 git.pkt.data=8 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=293470 git.pkt.payload.max=65516 git.sideband.band1.bytes=293354 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=87 git.pack.bytes=293354 git.pack.ofs_delta=0 git.pack.ref_delta=1 git.pack.chain.max=1 git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0 git.pack.full=86Open pack map
fetch20015 KiB · hit25 ms
git.upload-pack fetch http.response.status_code=200 git.response.bytes=15658 git.response.cache=HIT git.response.duration_ms=25 git.fetch.wants=64046a834afbf19a60d7ea06842942ac93230b1b git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=15658 git.pkt.payload.max=15637 git.sideband.band1.bytes=15636 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0
Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.
- Remote
- https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
- Ref
- refs/heads/master
- Commit
- 31c911efe5652725e930f4d2e60c9060e5f6646d
- cf-ray
- a5e327367c004628
- Request
- c38e33f8…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format