1 #***************************************************************************
3 # Project ___| | | | _ \| |
5 # | (__| |_| | _ <| |___
6 # \___|\___/|_| \_\_____|
8 # Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
10 # This software is licensed as described in the file COPYING, which
11 # you should have received as part of this distribution. The terms
12 # are also available at http://curl.haxx.se/docs/copyright.html.
14 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 # copies of the Software, and permit persons to whom the Software is
16 # furnished to do so, under the terms of the COPYING file.
18 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 # KIND, either express or implied.
22 #***************************************************************************
24 # File version for 'aclocal' use. Keep it a single number.
28 dnl CURL_INCLUDES_SIGNAL
29 dnl -------------------------------------------------
30 dnl Set up variable with list of headers that must be
31 dnl included when signal.h is to be included.
33 AC_DEFUN([CURL_INCLUDES_SIGNAL], [
34 curl_includes_signal="\
36 #ifdef HAVE_SYS_TYPES_H
37 # include <sys/types.h>
45 [], [], [$curl_includes_signal])
49 dnl CURL_INCLUDES_STDIO
50 dnl -------------------------------------------------
51 dnl Set up variable with list of headers that must be
52 dnl included when stdio.h is to be included.
54 AC_DEFUN([CURL_INCLUDES_STDIO], [
55 curl_includes_stdio="\
57 #ifdef HAVE_SYS_TYPES_H
58 # include <sys/types.h>
66 [], [], [$curl_includes_stdio])
70 dnl CURL_INCLUDES_STDLIB
71 dnl -------------------------------------------------
72 dnl Set up variable with list of headers that must be
73 dnl included when stdlib.h is to be included.
75 AC_DEFUN([CURL_INCLUDES_STDLIB], [
76 curl_includes_stdlib="\
78 #ifdef HAVE_SYS_TYPES_H
79 # include <sys/types.h>
87 [], [], [$curl_includes_stdlib])
91 dnl CURL_INCLUDES_STRING
92 dnl -------------------------------------------------
93 dnl Set up variable with list of headers that must be
94 dnl included when string(s).h is to be included.
96 AC_DEFUN([CURL_INCLUDES_STRING], [
97 curl_includes_string="\
99 #ifdef HAVE_SYS_TYPES_H
100 # include <sys/types.h>
105 #ifdef HAVE_STRINGS_H
106 # include <strings.h>
110 sys/types.h string.h strings.h,
111 [], [], [$curl_includes_string])
115 dnl CURL_INCLUDES_SYS_UIO
116 dnl -------------------------------------------------
117 dnl Set up variable with list of headers that must be
118 dnl included when sys/uio.h is to be included.
120 AC_DEFUN([CURL_INCLUDES_SYS_UIO], [
121 curl_includes_sys_uio="\
123 #ifdef HAVE_SYS_TYPES_H
124 # include <sys/types.h>
126 #ifdef HAVE_SYS_UIO_H
127 # include <sys/uio.h>
131 sys/types.h sys/uio.h,
132 [], [], [$curl_includes_sys_uio])
136 dnl CURL_INCLUDES_TIME
137 dnl -------------------------------------------------
138 dnl Set up variable with list of headers that must be
139 dnl included when time.h is to be included.
141 AC_DEFUN([CURL_INCLUDES_TIME], [
142 AC_REQUIRE([AC_HEADER_TIME])dnl
143 curl_includes_time="\
145 #ifdef HAVE_SYS_TYPES_H
146 # include <sys/types.h>
148 #ifdef HAVE_SYS_TIME_H
149 # include <sys/time.h>
150 # ifdef TIME_WITH_SYS_TIME
160 sys/types.h sys/time.h time.h,
161 [], [], [$curl_includes_time])
165 dnl CURL_INCLUDES_UNISTD
166 dnl -------------------------------------------------
167 dnl Set up variable with list of headers that must be
168 dnl included when unistd.h is to be included.
170 AC_DEFUN([CURL_INCLUDES_UNISTD], [
171 curl_includes_unistd="\
173 #ifdef HAVE_SYS_TYPES_H
174 # include <sys/types.h>
181 sys/types.h unistd.h,
182 [], [], [$curl_includes_unistd])
186 dnl CURL_CHECK_FUNC_FDOPEN
187 dnl -------------------------------------------------
188 dnl Verify if fdopen is available, prototyped, and
189 dnl can be compiled. If all of these are true, and
190 dnl usage has not been previously disallowed with
191 dnl shell variable curl_disallow_fdopen, then
192 dnl HAVE_FDOPEN will be defined.
194 AC_DEFUN([CURL_CHECK_FUNC_FDOPEN], [
195 AC_REQUIRE([CURL_INCLUDES_STDIO])dnl
197 tst_links_fdopen="unknown"
198 tst_proto_fdopen="unknown"
199 tst_compi_fdopen="unknown"
200 tst_allow_fdopen="unknown"
202 AC_MSG_CHECKING([if fdopen can be linked])
204 AC_LANG_FUNC_LINK_TRY([fdopen])
207 tst_links_fdopen="yes"
210 tst_links_fdopen="no"
213 if test "$tst_links_fdopen" = "yes"; then
214 AC_MSG_CHECKING([if fdopen is prototyped])
215 AC_EGREP_CPP([fdopen],[
219 tst_proto_fdopen="yes"
222 tst_proto_fdopen="no"
226 if test "$tst_proto_fdopen" = "yes"; then
227 AC_MSG_CHECKING([if fdopen is compilable])
232 if(0 != fdopen(0, 0))
237 tst_compi_fdopen="yes"
240 tst_compi_fdopen="no"
244 if test "$tst_compi_fdopen" = "yes"; then
245 AC_MSG_CHECKING([if fdopen usage allowed])
246 if test "x$curl_disallow_fdopen" != "xyes"; then
248 tst_allow_fdopen="yes"
251 tst_allow_fdopen="no"
255 AC_MSG_CHECKING([if fdopen might be used])
256 if test "$tst_links_fdopen" = "yes" &&
257 test "$tst_proto_fdopen" = "yes" &&
258 test "$tst_compi_fdopen" = "yes" &&
259 test "$tst_allow_fdopen" = "yes"; then
261 AC_DEFINE_UNQUOTED(HAVE_FDOPEN, 1,
262 [Define to 1 if you have the fdopen function.])
263 ac_cv_func_fdopen="yes"
266 ac_cv_func_fdopen="no"
271 dnl CURL_CHECK_FUNC_FTRUNCATE
272 dnl -------------------------------------------------
273 dnl Verify if ftruncate is available, prototyped, and
274 dnl can be compiled. If all of these are true, and
275 dnl usage has not been previously disallowed with
276 dnl shell variable curl_disallow_ftruncate, then
277 dnl HAVE_FTRUNCATE will be defined.
279 AC_DEFUN([CURL_CHECK_FUNC_FTRUNCATE], [
280 AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
282 tst_links_ftruncate="unknown"
283 tst_proto_ftruncate="unknown"
284 tst_compi_ftruncate="unknown"
285 tst_allow_ftruncate="unknown"
287 AC_MSG_CHECKING([if ftruncate can be linked])
289 AC_LANG_FUNC_LINK_TRY([ftruncate])
292 tst_links_ftruncate="yes"
295 tst_links_ftruncate="no"
298 if test "$tst_links_ftruncate" = "yes"; then
299 AC_MSG_CHECKING([if ftruncate is prototyped])
300 AC_EGREP_CPP([ftruncate],[
301 $curl_includes_unistd
304 tst_proto_ftruncate="yes"
307 tst_proto_ftruncate="no"
311 if test "$tst_proto_ftruncate" = "yes"; then
312 AC_MSG_CHECKING([if ftruncate is compilable])
315 $curl_includes_unistd
317 if(0 != ftruncate(0, 0))
322 tst_compi_ftruncate="yes"
325 tst_compi_ftruncate="no"
329 if test "$tst_compi_ftruncate" = "yes"; then
330 AC_MSG_CHECKING([if ftruncate usage allowed])
331 if test "x$curl_disallow_ftruncate" != "xyes"; then
333 tst_allow_ftruncate="yes"
336 tst_allow_ftruncate="no"
340 AC_MSG_CHECKING([if ftruncate might be used])
341 if test "$tst_links_ftruncate" = "yes" &&
342 test "$tst_proto_ftruncate" = "yes" &&
343 test "$tst_compi_ftruncate" = "yes" &&
344 test "$tst_allow_ftruncate" = "yes"; then
346 AC_DEFINE_UNQUOTED(HAVE_FTRUNCATE, 1,
347 [Define to 1 if you have the ftruncate function.])
348 ac_cv_func_ftruncate="yes"
351 ac_cv_func_ftruncate="no"
356 dnl CURL_CHECK_FUNC_GETHOSTNAME
357 dnl -------------------------------------------------
358 dnl Verify if gethostname is available, prototyped, and
359 dnl can be compiled. If all of these are true, and
360 dnl usage has not been previously disallowed with
361 dnl shell variable curl_disallow_gethostname, then
362 dnl HAVE_GETHOSTNAME will be defined.
364 AC_DEFUN([CURL_CHECK_FUNC_GETHOSTNAME], [
365 AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
367 tst_links_gethostname="unknown"
368 tst_proto_gethostname="unknown"
369 tst_compi_gethostname="unknown"
370 tst_allow_gethostname="unknown"
372 AC_MSG_CHECKING([if gethostname can be linked])
374 AC_LANG_FUNC_LINK_TRY([gethostname])
377 tst_links_gethostname="yes"
380 tst_links_gethostname="no"
383 if test "$tst_links_gethostname" = "yes"; then
384 AC_MSG_CHECKING([if gethostname is prototyped])
385 AC_EGREP_CPP([gethostname],[
386 $curl_includes_unistd
389 tst_proto_gethostname="yes"
392 tst_proto_gethostname="no"
396 if test "$tst_proto_gethostname" = "yes"; then
397 AC_MSG_CHECKING([if gethostname is compilable])
400 $curl_includes_unistd
402 if(0 != gethostname(0, 0))
407 tst_compi_gethostname="yes"
410 tst_compi_gethostname="no"
414 if test "$tst_compi_gethostname" = "yes"; then
415 AC_MSG_CHECKING([if gethostname usage allowed])
416 if test "x$curl_disallow_gethostname" != "xyes"; then
418 tst_allow_gethostname="yes"
421 tst_allow_gethostname="no"
425 AC_MSG_CHECKING([if gethostname might be used])
426 if test "$tst_links_gethostname" = "yes" &&
427 test "$tst_proto_gethostname" = "yes" &&
428 test "$tst_compi_gethostname" = "yes" &&
429 test "$tst_allow_gethostname" = "yes"; then
431 AC_DEFINE_UNQUOTED(HAVE_GETHOSTNAME, 1,
432 [Define to 1 if you have the gethostname function.])
433 ac_cv_func_gethostname="yes"
436 ac_cv_func_gethostname="no"
441 dnl CURL_CHECK_FUNC_GMTIME_R
442 dnl -------------------------------------------------
443 dnl Verify if gmtime_r is available, prototyped, can
444 dnl be compiled and seems to work. If all of these are
445 dnl true, and usage has not been previously disallowed
446 dnl with shell variable curl_disallow_gmtime_r, then
447 dnl HAVE_GMTIME_R will be defined.
449 AC_DEFUN([CURL_CHECK_FUNC_GMTIME_R], [
450 AC_REQUIRE([CURL_INCLUDES_TIME])dnl
452 tst_links_gmtime_r="unknown"
453 tst_proto_gmtime_r="unknown"
454 tst_compi_gmtime_r="unknown"
455 tst_works_gmtime_r="unknown"
456 tst_allow_gmtime_r="unknown"
458 AC_MSG_CHECKING([if gmtime_r can be linked])
460 AC_LANG_FUNC_LINK_TRY([gmtime_r])
463 tst_links_gmtime_r="yes"
466 tst_links_gmtime_r="no"
469 if test "$tst_links_gmtime_r" = "yes"; then
470 AC_MSG_CHECKING([if gmtime_r is prototyped])
471 AC_EGREP_CPP([gmtime_r],[
475 tst_proto_gmtime_r="yes"
478 tst_proto_gmtime_r="no"
482 if test "$tst_proto_gmtime_r" = "yes"; then
483 AC_MSG_CHECKING([if gmtime_r is compilable])
488 if(0 != gmtime_r(0, 0))
493 tst_compi_gmtime_r="yes"
496 tst_compi_gmtime_r="no"
500 dnl only do runtime verification when not cross-compiling
501 if test "x$cross_compiling" != "xyes" &&
502 test "$tst_compi_gmtime_r" = "yes"; then
503 AC_MSG_CHECKING([if gmtime_r seems to work])
508 time_t local = 1170352587;
511 gmt = gmtime_r(&local, &result);
519 tst_works_gmtime_r="yes"
522 tst_works_gmtime_r="no"
526 if test "$tst_compi_gmtime_r" = "yes" &&
527 test "$tst_works_gmtime_r" != "no"; then
528 AC_MSG_CHECKING([if gmtime_r usage allowed])
529 if test "x$curl_disallow_gmtime_r" != "xyes"; then
531 tst_allow_gmtime_r="yes"
534 tst_allow_gmtime_r="no"
538 AC_MSG_CHECKING([if gmtime_r might be used])
539 if test "$tst_links_gmtime_r" = "yes" &&
540 test "$tst_proto_gmtime_r" = "yes" &&
541 test "$tst_compi_gmtime_r" = "yes" &&
542 test "$tst_allow_gmtime_r" = "yes" &&
543 test "$tst_works_gmtime_r" != "no"; then
545 AC_DEFINE_UNQUOTED(HAVE_GMTIME_R, 1,
546 [Define to 1 if you have a working gmtime_r function.])
547 ac_cv_func_gmtime_r="yes"
550 ac_cv_func_gmtime_r="no"
555 dnl CURL_CHECK_FUNC_LOCALTIME_R
556 dnl -------------------------------------------------
557 dnl Verify if localtime_r is available, prototyped, can
558 dnl be compiled and seems to work. If all of these are
559 dnl true, and usage has not been previously disallowed
560 dnl with shell variable curl_disallow_localtime_r, then
561 dnl HAVE_LOCALTIME_R will be defined.
563 AC_DEFUN([CURL_CHECK_FUNC_LOCALTIME_R], [
564 AC_REQUIRE([CURL_INCLUDES_TIME])dnl
566 tst_links_localtime_r="unknown"
567 tst_proto_localtime_r="unknown"
568 tst_compi_localtime_r="unknown"
569 tst_works_localtime_r="unknown"
570 tst_allow_localtime_r="unknown"
572 AC_MSG_CHECKING([if localtime_r can be linked])
574 AC_LANG_FUNC_LINK_TRY([localtime_r])
577 tst_links_localtime_r="yes"
580 tst_links_localtime_r="no"
583 if test "$tst_links_localtime_r" = "yes"; then
584 AC_MSG_CHECKING([if localtime_r is prototyped])
585 AC_EGREP_CPP([localtime_r],[
589 tst_proto_localtime_r="yes"
592 tst_proto_localtime_r="no"
596 if test "$tst_proto_localtime_r" = "yes"; then
597 AC_MSG_CHECKING([if localtime_r is compilable])
602 if(0 != localtime_r(0, 0))
607 tst_compi_localtime_r="yes"
610 tst_compi_localtime_r="no"
614 dnl only do runtime verification when not cross-compiling
615 if test "x$cross_compiling" != "xyes" &&
616 test "$tst_compi_localtime_r" = "yes"; then
617 AC_MSG_CHECKING([if localtime_r seems to work])
622 time_t clock = 1170352587;
625 tmp = localtime_r(&clock, &result);
633 tst_works_localtime_r="yes"
636 tst_works_localtime_r="no"
640 if test "$tst_compi_localtime_r" = "yes" &&
641 test "$tst_works_localtime_r" != "no"; then
642 AC_MSG_CHECKING([if localtime_r usage allowed])
643 if test "x$curl_disallow_localtime_r" != "xyes"; then
645 tst_allow_localtime_r="yes"
648 tst_allow_localtime_r="no"
652 AC_MSG_CHECKING([if localtime_r might be used])
653 if test "$tst_links_localtime_r" = "yes" &&
654 test "$tst_proto_localtime_r" = "yes" &&
655 test "$tst_compi_localtime_r" = "yes" &&
656 test "$tst_allow_localtime_r" = "yes" &&
657 test "$tst_works_localtime_r" != "no"; then
659 AC_DEFINE_UNQUOTED(HAVE_LOCALTIME_R, 1,
660 [Define to 1 if you have a working localtime_r function.])
661 ac_cv_func_localtime_r="yes"
664 ac_cv_func_localtime_r="no"
669 dnl CURL_CHECK_FUNC_SIGACTION
670 dnl -------------------------------------------------
671 dnl Verify if sigaction is available, prototyped, and
672 dnl can be compiled. If all of these are true, and
673 dnl usage has not been previously disallowed with
674 dnl shell variable curl_disallow_sigaction, then
675 dnl HAVE_SIGACTION will be defined.
677 AC_DEFUN([CURL_CHECK_FUNC_SIGACTION], [
678 AC_REQUIRE([CURL_INCLUDES_SIGNAL])dnl
680 tst_links_sigaction="unknown"
681 tst_proto_sigaction="unknown"
682 tst_compi_sigaction="unknown"
683 tst_allow_sigaction="unknown"
685 AC_MSG_CHECKING([if sigaction can be linked])
687 AC_LANG_FUNC_LINK_TRY([sigaction])
690 tst_links_sigaction="yes"
693 tst_links_sigaction="no"
696 if test "$tst_links_sigaction" = "yes"; then
697 AC_MSG_CHECKING([if sigaction is prototyped])
698 AC_EGREP_CPP([sigaction],[
699 $curl_includes_signal
702 tst_proto_sigaction="yes"
705 tst_proto_sigaction="no"
709 if test "$tst_proto_sigaction" = "yes"; then
710 AC_MSG_CHECKING([if sigaction is compilable])
713 $curl_includes_signal
715 if(0 != sigaction(0, 0, 0))
720 tst_compi_sigaction="yes"
723 tst_compi_sigaction="no"
727 if test "$tst_compi_sigaction" = "yes"; then
728 AC_MSG_CHECKING([if sigaction usage allowed])
729 if test "x$curl_disallow_sigaction" != "xyes"; then
731 tst_allow_sigaction="yes"
734 tst_allow_sigaction="no"
738 AC_MSG_CHECKING([if sigaction might be used])
739 if test "$tst_links_sigaction" = "yes" &&
740 test "$tst_proto_sigaction" = "yes" &&
741 test "$tst_compi_sigaction" = "yes" &&
742 test "$tst_allow_sigaction" = "yes"; then
744 AC_DEFINE_UNQUOTED(HAVE_SIGACTION, 1,
745 [Define to 1 if you have the sigaction function.])
746 ac_cv_func_sigaction="yes"
749 ac_cv_func_sigaction="no"
754 dnl CURL_CHECK_FUNC_STRCASECMP
755 dnl -------------------------------------------------
756 dnl Verify if strcasecmp is available, prototyped, and
757 dnl can be compiled. If all of these are true, and
758 dnl usage has not been previously disallowed with
759 dnl shell variable curl_disallow_strcasecmp, then
760 dnl HAVE_STRCASECMP will be defined.
762 AC_DEFUN([CURL_CHECK_FUNC_STRCASECMP], [
763 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
765 tst_links_strcasecmp="unknown"
766 tst_proto_strcasecmp="unknown"
767 tst_compi_strcasecmp="unknown"
768 tst_allow_strcasecmp="unknown"
770 AC_MSG_CHECKING([if strcasecmp can be linked])
772 AC_LANG_FUNC_LINK_TRY([strcasecmp])
775 tst_links_strcasecmp="yes"
778 tst_links_strcasecmp="no"
781 if test "$tst_links_strcasecmp" = "yes"; then
782 AC_MSG_CHECKING([if strcasecmp is prototyped])
783 AC_EGREP_CPP([strcasecmp],[
784 $curl_includes_string
787 tst_proto_strcasecmp="yes"
790 tst_proto_strcasecmp="no"
794 if test "$tst_proto_strcasecmp" = "yes"; then
795 AC_MSG_CHECKING([if strcasecmp is compilable])
798 $curl_includes_string
800 if(0 != strcasecmp(0, 0))
805 tst_compi_strcasecmp="yes"
808 tst_compi_strcasecmp="no"
812 if test "$tst_compi_strcasecmp" = "yes"; then
813 AC_MSG_CHECKING([if strcasecmp usage allowed])
814 if test "x$curl_disallow_strcasecmp" != "xyes"; then
816 tst_allow_strcasecmp="yes"
819 tst_allow_strcasecmp="no"
823 AC_MSG_CHECKING([if strcasecmp might be used])
824 if test "$tst_links_strcasecmp" = "yes" &&
825 test "$tst_proto_strcasecmp" = "yes" &&
826 test "$tst_compi_strcasecmp" = "yes" &&
827 test "$tst_allow_strcasecmp" = "yes"; then
829 AC_DEFINE_UNQUOTED(HAVE_STRCASECMP, 1,
830 [Define to 1 if you have the strcasecmp function.])
831 ac_cv_func_strcasecmp="yes"
834 ac_cv_func_strcasecmp="no"
839 dnl CURL_CHECK_FUNC_STRCASESTR
840 dnl -------------------------------------------------
841 dnl Verify if strcasestr is available, prototyped, and
842 dnl can be compiled. If all of these are true, and
843 dnl usage has not been previously disallowed with
844 dnl shell variable curl_disallow_strcasestr, then
845 dnl HAVE_STRCASESTR will be defined.
847 AC_DEFUN([CURL_CHECK_FUNC_STRCASESTR], [
848 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
850 tst_links_strcasestr="unknown"
851 tst_proto_strcasestr="unknown"
852 tst_compi_strcasestr="unknown"
853 tst_allow_strcasestr="unknown"
855 AC_MSG_CHECKING([if strcasestr can be linked])
857 AC_LANG_FUNC_LINK_TRY([strcasestr])
860 tst_links_strcasestr="yes"
863 tst_links_strcasestr="no"
866 if test "$tst_links_strcasestr" = "yes"; then
867 AC_MSG_CHECKING([if strcasestr is prototyped])
868 AC_EGREP_CPP([strcasestr],[
869 $curl_includes_string
872 tst_proto_strcasestr="yes"
875 tst_proto_strcasestr="no"
879 if test "$tst_proto_strcasestr" = "yes"; then
880 AC_MSG_CHECKING([if strcasestr is compilable])
883 $curl_includes_string
885 if(0 != strcasestr(0, 0))
890 tst_compi_strcasestr="yes"
893 tst_compi_strcasestr="no"
897 if test "$tst_compi_strcasestr" = "yes"; then
898 AC_MSG_CHECKING([if strcasestr usage allowed])
899 if test "x$curl_disallow_strcasestr" != "xyes"; then
901 tst_allow_strcasestr="yes"
904 tst_allow_strcasestr="no"
908 AC_MSG_CHECKING([if strcasestr might be used])
909 if test "$tst_links_strcasestr" = "yes" &&
910 test "$tst_proto_strcasestr" = "yes" &&
911 test "$tst_compi_strcasestr" = "yes" &&
912 test "$tst_allow_strcasestr" = "yes"; then
914 AC_DEFINE_UNQUOTED(HAVE_STRCASESTR, 1,
915 [Define to 1 if you have the strcasestr function.])
916 ac_cv_func_strcasestr="yes"
919 ac_cv_func_strcasestr="no"
924 dnl CURL_CHECK_FUNC_STRCMPI
925 dnl -------------------------------------------------
926 dnl Verify if strcmpi is available, prototyped, and
927 dnl can be compiled. If all of these are true, and
928 dnl usage has not been previously disallowed with
929 dnl shell variable curl_disallow_strcmpi, then
930 dnl HAVE_STRCMPI will be defined.
932 AC_DEFUN([CURL_CHECK_FUNC_STRCMPI], [
933 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
935 tst_links_strcmpi="unknown"
936 tst_proto_strcmpi="unknown"
937 tst_compi_strcmpi="unknown"
938 tst_allow_strcmpi="unknown"
940 AC_MSG_CHECKING([if strcmpi can be linked])
942 AC_LANG_FUNC_LINK_TRY([strcmpi])
945 tst_links_strcmpi="yes"
948 tst_links_strcmpi="no"
951 if test "$tst_links_strcmpi" = "yes"; then
952 AC_MSG_CHECKING([if strcmpi is prototyped])
953 AC_EGREP_CPP([strcmpi],[
954 $curl_includes_string
957 tst_proto_strcmpi="yes"
960 tst_proto_strcmpi="no"
964 if test "$tst_proto_strcmpi" = "yes"; then
965 AC_MSG_CHECKING([if strcmpi is compilable])
968 $curl_includes_string
970 if(0 != strcmpi(0, 0))
975 tst_compi_strcmpi="yes"
978 tst_compi_strcmpi="no"
982 if test "$tst_compi_strcmpi" = "yes"; then
983 AC_MSG_CHECKING([if strcmpi usage allowed])
984 if test "x$curl_disallow_strcmpi" != "xyes"; then
986 tst_allow_strcmpi="yes"
989 tst_allow_strcmpi="no"
993 AC_MSG_CHECKING([if strcmpi might be used])
994 if test "$tst_links_strcmpi" = "yes" &&
995 test "$tst_proto_strcmpi" = "yes" &&
996 test "$tst_compi_strcmpi" = "yes" &&
997 test "$tst_allow_strcmpi" = "yes"; then
999 AC_DEFINE_UNQUOTED(HAVE_STRCMPI, 1,
1000 [Define to 1 if you have the strcmpi function.])
1001 ac_cv_func_strcmpi="yes"
1004 ac_cv_func_strcmpi="no"
1009 dnl CURL_CHECK_FUNC_STRDUP
1010 dnl -------------------------------------------------
1011 dnl Verify if strdup is available, prototyped, and
1012 dnl can be compiled. If all of these are true, and
1013 dnl usage has not been previously disallowed with
1014 dnl shell variable curl_disallow_strdup, then
1015 dnl HAVE_STRDUP will be defined.
1017 AC_DEFUN([CURL_CHECK_FUNC_STRDUP], [
1018 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
1020 tst_links_strdup="unknown"
1021 tst_proto_strdup="unknown"
1022 tst_compi_strdup="unknown"
1023 tst_allow_strdup="unknown"
1025 AC_MSG_CHECKING([if strdup can be linked])
1027 AC_LANG_FUNC_LINK_TRY([strdup])
1029 AC_MSG_RESULT([yes])
1030 tst_links_strdup="yes"
1033 tst_links_strdup="no"
1036 if test "$tst_links_strdup" = "yes"; then
1037 AC_MSG_CHECKING([if strdup is prototyped])
1038 AC_EGREP_CPP([strdup],[
1039 $curl_includes_string
1041 AC_MSG_RESULT([yes])
1042 tst_proto_strdup="yes"
1045 tst_proto_strdup="no"
1049 if test "$tst_proto_strdup" = "yes"; then
1050 AC_MSG_CHECKING([if strdup is compilable])
1053 $curl_includes_string
1059 AC_MSG_RESULT([yes])
1060 tst_compi_strdup="yes"
1063 tst_compi_strdup="no"
1067 if test "$tst_compi_strdup" = "yes"; then
1068 AC_MSG_CHECKING([if strdup usage allowed])
1069 if test "x$curl_disallow_strdup" != "xyes"; then
1070 AC_MSG_RESULT([yes])
1071 tst_allow_strdup="yes"
1074 tst_allow_strdup="no"
1078 AC_MSG_CHECKING([if strdup might be used])
1079 if test "$tst_links_strdup" = "yes" &&
1080 test "$tst_proto_strdup" = "yes" &&
1081 test "$tst_compi_strdup" = "yes" &&
1082 test "$tst_allow_strdup" = "yes"; then
1083 AC_MSG_RESULT([yes])
1084 AC_DEFINE_UNQUOTED(HAVE_STRDUP, 1,
1085 [Define to 1 if you have the strdup function.])
1086 ac_cv_func_strdup="yes"
1089 ac_cv_func_strdup="no"
1094 dnl CURL_CHECK_FUNC_STRERROR_R
1095 dnl -------------------------------------------------
1096 dnl Verify if strerror_r is available, prototyped, can be compiled and
1097 dnl seems to work. If all of these are true, and usage has not been
1098 dnl previously disallowed with shell variable curl_disallow_strerror_r,
1099 dnl then HAVE_STRERROR_R and STRERROR_R_TYPE_ARG3 will be defined, as
1100 dnl well as one of HAVE_GLIBC_STRERROR_R or HAVE_POSIX_STRERROR_R.
1102 dnl glibc-style strerror_r:
1104 dnl char *strerror_r(int errnum, char *workbuf, size_t bufsize);
1106 dnl glibc-style strerror_r returns a pointer to the the error string,
1107 dnl and might use the provided workbuf as a scratch area if needed. A
1108 dnl quick test on a few systems shows that it's usually not used at all.
1110 dnl POSIX-style strerror_r:
1112 dnl int strerror_r(int errnum, char *resultbuf, size_t bufsize);
1114 dnl POSIX-style strerror_r returns 0 upon successful completion and the
1115 dnl error string in the provided resultbuf.
1118 AC_DEFUN([CURL_CHECK_FUNC_STRERROR_R], [
1119 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
1121 tst_links_strerror_r="unknown"
1122 tst_proto_strerror_r="unknown"
1123 tst_compi_strerror_r="unknown"
1124 tst_glibc_strerror_r="unknown"
1125 tst_posix_strerror_r="unknown"
1126 tst_allow_strerror_r="unknown"
1127 tst_works_glibc_strerror_r="unknown"
1128 tst_works_posix_strerror_r="unknown"
1129 tst_glibc_strerror_r_type_arg3="unknown"
1130 tst_posix_strerror_r_type_arg3="unknown"
1132 AC_MSG_CHECKING([if strerror_r can be linked])
1134 AC_LANG_FUNC_LINK_TRY([strerror_r])
1136 AC_MSG_RESULT([yes])
1137 tst_links_strerror_r="yes"
1140 tst_links_strerror_r="no"
1143 if test "$tst_links_strerror_r" = "yes"; then
1144 AC_MSG_CHECKING([if strerror_r is prototyped])
1145 AC_EGREP_CPP([strerror_r],[
1146 $curl_includes_string
1148 AC_MSG_RESULT([yes])
1149 tst_proto_strerror_r="yes"
1152 tst_proto_strerror_r="no"
1156 if test "$tst_proto_strerror_r" = "yes"; then
1157 AC_MSG_CHECKING([if strerror_r is compilable])
1160 $curl_includes_string
1162 if(0 != strerror_r(0, 0, 0))
1166 AC_MSG_RESULT([yes])
1167 tst_compi_strerror_r="yes"
1170 tst_compi_strerror_r="no"
1174 if test "$tst_compi_strerror_r" = "yes"; then
1175 AC_MSG_CHECKING([if strerror_r is glibc like])
1176 tst_glibc_strerror_r_type_arg3="unknown"
1177 for arg3 in 'size_t' 'int' 'unsigned int'; do
1178 if test "$tst_glibc_strerror_r_type_arg3" = "unknown"; then
1181 $curl_includes_string
1183 char *strerror_r(int errnum, char *workbuf, $arg3 bufsize);
1184 if(0 != strerror_r(0, 0, 0))
1188 tst_glibc_strerror_r_type_arg3="$arg3"
1192 case "$tst_glibc_strerror_r_type_arg3" in
1195 tst_glibc_strerror_r="no"
1198 AC_MSG_RESULT([yes])
1199 tst_glibc_strerror_r="yes"
1204 dnl only do runtime verification when not cross-compiling
1205 if test "x$cross_compiling" != "xyes" &&
1206 test "$tst_glibc_strerror_r" = "yes"; then
1207 AC_MSG_CHECKING([if strerror_r seems to work])
1210 $curl_includes_string
1216 string = strerror_r(EACCES, buffer, sizeof(buffer));
1225 AC_MSG_RESULT([yes])
1226 tst_works_glibc_strerror_r="yes"
1229 tst_works_glibc_strerror_r="no"
1233 if test "$tst_compi_strerror_r" = "yes" &&
1234 test "$tst_works_glibc_strerror_r" != "yes"; then
1235 AC_MSG_CHECKING([if strerror_r is POSIX like])
1236 tst_posix_strerror_r_type_arg3="unknown"
1237 for arg3 in 'size_t' 'int' 'unsigned int'; do
1238 if test "$tst_posix_strerror_r_type_arg3" = "unknown"; then
1241 $curl_includes_string
1243 int strerror_r(int errnum, char *resultbuf, $arg3 bufsize);
1244 if(0 != strerror_r(0, 0, 0))
1248 tst_posix_strerror_r_type_arg3="$arg3"
1252 case "$tst_posix_strerror_r_type_arg3" in
1255 tst_posix_strerror_r="no"
1258 AC_MSG_RESULT([yes])
1259 tst_posix_strerror_r="yes"
1264 dnl only do runtime verification when not cross-compiling
1265 if test "x$cross_compiling" != "xyes" &&
1266 test "$tst_posix_strerror_r" = "yes"; then
1267 AC_MSG_CHECKING([if strerror_r seems to work])
1270 $curl_includes_string
1276 error = strerror_r(EACCES, buffer, sizeof(buffer));
1279 if(buffer[0] == '\0')
1285 AC_MSG_RESULT([yes])
1286 tst_works_posix_strerror_r="yes"
1289 tst_works_posix_strerror_r="no"
1293 if test "$tst_glibc_strerror_r" = "yes" &&
1294 test "$tst_works_glibc_strerror_r" != "no" &&
1295 test "$tst_posix_strerror_r" != "yes"; then
1296 tst_allow_strerror_r="check"
1298 if test "$tst_posix_strerror_r" = "yes" &&
1299 test "$tst_works_posix_strerror_r" != "no" &&
1300 test "$tst_glibc_strerror_r" != "yes"; then
1301 tst_allow_strerror_r="check"
1303 if test "$tst_allow_strerror_r" = "check"; then
1304 AC_MSG_CHECKING([if strerror_r usage allowed])
1305 if test "x$curl_disallow_strerror_r" != "xyes"; then
1306 AC_MSG_RESULT([yes])
1307 tst_allow_strerror_r="yes"
1310 tst_allow_strerror_r="no"
1314 AC_MSG_CHECKING([if strerror_r might be used])
1315 if test "$tst_links_strerror_r" = "yes" &&
1316 test "$tst_proto_strerror_r" = "yes" &&
1317 test "$tst_compi_strerror_r" = "yes" &&
1318 test "$tst_allow_strerror_r" = "yes"; then
1319 AC_MSG_RESULT([yes])
1320 if test "$tst_glibc_strerror_r" = "yes"; then
1321 AC_DEFINE_UNQUOTED(HAVE_STRERROR_R, 1,
1322 [Define to 1 if you have the strerror_r function.])
1323 AC_DEFINE_UNQUOTED(HAVE_GLIBC_STRERROR_R, 1,
1324 [Define to 1 if you have a working glibc-style strerror_r function.])
1325 AC_DEFINE_UNQUOTED(STRERROR_R_TYPE_ARG3, $tst_glibc_strerror_r_type_arg3,
1326 [Define to the type of arg 3 for strerror_r.])
1328 if test "$tst_posix_strerror_r" = "yes"; then
1329 AC_DEFINE_UNQUOTED(HAVE_STRERROR_R, 1,
1330 [Define to 1 if you have the strerror_r function.])
1331 AC_DEFINE_UNQUOTED(HAVE_POSIX_STRERROR_R, 1,
1332 [Define to 1 if you have a working POSIX-style strerror_r function.])
1333 AC_DEFINE_UNQUOTED(STRERROR_R_TYPE_ARG3, $tst_posix_strerror_r_type_arg3,
1334 [Define to the type of arg 3 for strerror_r.])
1336 ac_cv_func_strerror_r="yes"
1339 ac_cv_func_strerror_r="no"
1342 if test "$tst_compi_strerror_r" = "yes" &&
1343 test "$tst_allow_strerror_r" = "unknown"; then
1344 AC_MSG_NOTICE([cannot determine strerror_r() style: edit lib/config.h manually.])
1350 dnl CURL_CHECK_FUNC_STRICMP
1351 dnl -------------------------------------------------
1352 dnl Verify if stricmp is available, prototyped, and
1353 dnl can be compiled. If all of these are true, and
1354 dnl usage has not been previously disallowed with
1355 dnl shell variable curl_disallow_stricmp, then
1356 dnl HAVE_STRICMP will be defined.
1358 AC_DEFUN([CURL_CHECK_FUNC_STRICMP], [
1359 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
1361 tst_links_stricmp="unknown"
1362 tst_proto_stricmp="unknown"
1363 tst_compi_stricmp="unknown"
1364 tst_allow_stricmp="unknown"
1366 AC_MSG_CHECKING([if stricmp can be linked])
1368 AC_LANG_FUNC_LINK_TRY([stricmp])
1370 AC_MSG_RESULT([yes])
1371 tst_links_stricmp="yes"
1374 tst_links_stricmp="no"
1377 if test "$tst_links_stricmp" = "yes"; then
1378 AC_MSG_CHECKING([if stricmp is prototyped])
1379 AC_EGREP_CPP([stricmp],[
1380 $curl_includes_string
1382 AC_MSG_RESULT([yes])
1383 tst_proto_stricmp="yes"
1386 tst_proto_stricmp="no"
1390 if test "$tst_proto_stricmp" = "yes"; then
1391 AC_MSG_CHECKING([if stricmp is compilable])
1394 $curl_includes_string
1396 if(0 != stricmp(0, 0))
1400 AC_MSG_RESULT([yes])
1401 tst_compi_stricmp="yes"
1404 tst_compi_stricmp="no"
1408 if test "$tst_compi_stricmp" = "yes"; then
1409 AC_MSG_CHECKING([if stricmp usage allowed])
1410 if test "x$curl_disallow_stricmp" != "xyes"; then
1411 AC_MSG_RESULT([yes])
1412 tst_allow_stricmp="yes"
1415 tst_allow_stricmp="no"
1419 AC_MSG_CHECKING([if stricmp might be used])
1420 if test "$tst_links_stricmp" = "yes" &&
1421 test "$tst_proto_stricmp" = "yes" &&
1422 test "$tst_compi_stricmp" = "yes" &&
1423 test "$tst_allow_stricmp" = "yes"; then
1424 AC_MSG_RESULT([yes])
1425 AC_DEFINE_UNQUOTED(HAVE_STRICMP, 1,
1426 [Define to 1 if you have the stricmp function.])
1427 ac_cv_func_stricmp="yes"
1430 ac_cv_func_stricmp="no"
1435 dnl CURL_CHECK_FUNC_STRLCAT
1436 dnl -------------------------------------------------
1437 dnl Verify if strlcat is available, prototyped, and
1438 dnl can be compiled. If all of these are true, and
1439 dnl usage has not been previously disallowed with
1440 dnl shell variable curl_disallow_strlcat, then
1441 dnl HAVE_STRLCAT will be defined.
1443 AC_DEFUN([CURL_CHECK_FUNC_STRLCAT], [
1444 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
1446 tst_links_strlcat="unknown"
1447 tst_proto_strlcat="unknown"
1448 tst_compi_strlcat="unknown"
1449 tst_allow_strlcat="unknown"
1451 AC_MSG_CHECKING([if strlcat can be linked])
1453 AC_LANG_FUNC_LINK_TRY([strlcat])
1455 AC_MSG_RESULT([yes])
1456 tst_links_strlcat="yes"
1459 tst_links_strlcat="no"
1462 if test "$tst_links_strlcat" = "yes"; then
1463 AC_MSG_CHECKING([if strlcat is prototyped])
1464 AC_EGREP_CPP([strlcat],[
1465 $curl_includes_string
1467 AC_MSG_RESULT([yes])
1468 tst_proto_strlcat="yes"
1471 tst_proto_strlcat="no"
1475 if test "$tst_proto_strlcat" = "yes"; then
1476 AC_MSG_CHECKING([if strlcat is compilable])
1479 $curl_includes_string
1481 if(0 != strlcat(0, 0, 0))
1485 AC_MSG_RESULT([yes])
1486 tst_compi_strlcat="yes"
1489 tst_compi_strlcat="no"
1493 if test "$tst_compi_strlcat" = "yes"; then
1494 AC_MSG_CHECKING([if strlcat usage allowed])
1495 if test "x$curl_disallow_strlcat" != "xyes"; then
1496 AC_MSG_RESULT([yes])
1497 tst_allow_strlcat="yes"
1500 tst_allow_strlcat="no"
1504 AC_MSG_CHECKING([if strlcat might be used])
1505 if test "$tst_links_strlcat" = "yes" &&
1506 test "$tst_proto_strlcat" = "yes" &&
1507 test "$tst_compi_strlcat" = "yes" &&
1508 test "$tst_allow_strlcat" = "yes"; then
1509 AC_MSG_RESULT([yes])
1510 AC_DEFINE_UNQUOTED(HAVE_STRLCAT, 1,
1511 [Define to 1 if you have the strlcat function.])
1512 ac_cv_func_strlcat="yes"
1515 ac_cv_func_strlcat="no"
1520 dnl CURL_CHECK_FUNC_STRNCASECMP
1521 dnl -------------------------------------------------
1522 dnl Verify if strncasecmp is available, prototyped, and
1523 dnl can be compiled. If all of these are true, and
1524 dnl usage has not been previously disallowed with
1525 dnl shell variable curl_disallow_strncasecmp, then
1526 dnl HAVE_STRNCASECMP will be defined.
1528 AC_DEFUN([CURL_CHECK_FUNC_STRNCASECMP], [
1529 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
1531 tst_links_strncasecmp="unknown"
1532 tst_proto_strncasecmp="unknown"
1533 tst_compi_strncasecmp="unknown"
1534 tst_allow_strncasecmp="unknown"
1536 AC_MSG_CHECKING([if strncasecmp can be linked])
1538 AC_LANG_FUNC_LINK_TRY([strncasecmp])
1540 AC_MSG_RESULT([yes])
1541 tst_links_strncasecmp="yes"
1544 tst_links_strncasecmp="no"
1547 if test "$tst_links_strncasecmp" = "yes"; then
1548 AC_MSG_CHECKING([if strncasecmp is prototyped])
1549 AC_EGREP_CPP([strncasecmp],[
1550 $curl_includes_string
1552 AC_MSG_RESULT([yes])
1553 tst_proto_strncasecmp="yes"
1556 tst_proto_strncasecmp="no"
1560 if test "$tst_proto_strncasecmp" = "yes"; then
1561 AC_MSG_CHECKING([if strncasecmp is compilable])
1564 $curl_includes_string
1566 if(0 != strncasecmp(0, 0, 0))
1570 AC_MSG_RESULT([yes])
1571 tst_compi_strncasecmp="yes"
1574 tst_compi_strncasecmp="no"
1578 if test "$tst_compi_strncasecmp" = "yes"; then
1579 AC_MSG_CHECKING([if strncasecmp usage allowed])
1580 if test "x$curl_disallow_strncasecmp" != "xyes"; then
1581 AC_MSG_RESULT([yes])
1582 tst_allow_strncasecmp="yes"
1585 tst_allow_strncasecmp="no"
1589 AC_MSG_CHECKING([if strncasecmp might be used])
1590 if test "$tst_links_strncasecmp" = "yes" &&
1591 test "$tst_proto_strncasecmp" = "yes" &&
1592 test "$tst_compi_strncasecmp" = "yes" &&
1593 test "$tst_allow_strncasecmp" = "yes"; then
1594 AC_MSG_RESULT([yes])
1595 AC_DEFINE_UNQUOTED(HAVE_STRNCASECMP, 1,
1596 [Define to 1 if you have the strncasecmp function.])
1597 ac_cv_func_strncasecmp="yes"
1600 ac_cv_func_strncasecmp="no"
1605 dnl CURL_CHECK_FUNC_STRNCMPI
1606 dnl -------------------------------------------------
1607 dnl Verify if strncmpi is available, prototyped, and
1608 dnl can be compiled. If all of these are true, and
1609 dnl usage has not been previously disallowed with
1610 dnl shell variable curl_disallow_strncmpi, then
1611 dnl HAVE_STRNCMPI will be defined.
1613 AC_DEFUN([CURL_CHECK_FUNC_STRNCMPI], [
1614 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
1616 tst_links_strncmpi="unknown"
1617 tst_proto_strncmpi="unknown"
1618 tst_compi_strncmpi="unknown"
1619 tst_allow_strncmpi="unknown"
1621 AC_MSG_CHECKING([if strncmpi can be linked])
1623 AC_LANG_FUNC_LINK_TRY([strncmpi])
1625 AC_MSG_RESULT([yes])
1626 tst_links_strncmpi="yes"
1629 tst_links_strncmpi="no"
1632 if test "$tst_links_strncmpi" = "yes"; then
1633 AC_MSG_CHECKING([if strncmpi is prototyped])
1634 AC_EGREP_CPP([strncmpi],[
1635 $curl_includes_string
1637 AC_MSG_RESULT([yes])
1638 tst_proto_strncmpi="yes"
1641 tst_proto_strncmpi="no"
1645 if test "$tst_proto_strncmpi" = "yes"; then
1646 AC_MSG_CHECKING([if strncmpi is compilable])
1649 $curl_includes_string
1651 if(0 != strncmpi(0, 0))
1655 AC_MSG_RESULT([yes])
1656 tst_compi_strncmpi="yes"
1659 tst_compi_strncmpi="no"
1663 if test "$tst_compi_strncmpi" = "yes"; then
1664 AC_MSG_CHECKING([if strncmpi usage allowed])
1665 if test "x$curl_disallow_strncmpi" != "xyes"; then
1666 AC_MSG_RESULT([yes])
1667 tst_allow_strncmpi="yes"
1670 tst_allow_strncmpi="no"
1674 AC_MSG_CHECKING([if strncmpi might be used])
1675 if test "$tst_links_strncmpi" = "yes" &&
1676 test "$tst_proto_strncmpi" = "yes" &&
1677 test "$tst_compi_strncmpi" = "yes" &&
1678 test "$tst_allow_strncmpi" = "yes"; then
1679 AC_MSG_RESULT([yes])
1680 AC_DEFINE_UNQUOTED(HAVE_STRNCMPI, 1,
1681 [Define to 1 if you have the strncmpi function.])
1682 ac_cv_func_strncmpi="yes"
1685 ac_cv_func_strncmpi="no"
1690 dnl CURL_CHECK_FUNC_STRNICMP
1691 dnl -------------------------------------------------
1692 dnl Verify if strnicmp is available, prototyped, and
1693 dnl can be compiled. If all of these are true, and
1694 dnl usage has not been previously disallowed with
1695 dnl shell variable curl_disallow_strnicmp, then
1696 dnl HAVE_STRNICMP will be defined.
1698 AC_DEFUN([CURL_CHECK_FUNC_STRNICMP], [
1699 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
1701 tst_links_strnicmp="unknown"
1702 tst_proto_strnicmp="unknown"
1703 tst_compi_strnicmp="unknown"
1704 tst_allow_strnicmp="unknown"
1706 AC_MSG_CHECKING([if strnicmp can be linked])
1708 AC_LANG_FUNC_LINK_TRY([strnicmp])
1710 AC_MSG_RESULT([yes])
1711 tst_links_strnicmp="yes"
1714 tst_links_strnicmp="no"
1717 if test "$tst_links_strnicmp" = "yes"; then
1718 AC_MSG_CHECKING([if strnicmp is prototyped])
1719 AC_EGREP_CPP([strnicmp],[
1720 $curl_includes_string
1722 AC_MSG_RESULT([yes])
1723 tst_proto_strnicmp="yes"
1726 tst_proto_strnicmp="no"
1730 if test "$tst_proto_strnicmp" = "yes"; then
1731 AC_MSG_CHECKING([if strnicmp is compilable])
1734 $curl_includes_string
1736 if(0 != strnicmp(0, 0))
1740 AC_MSG_RESULT([yes])
1741 tst_compi_strnicmp="yes"
1744 tst_compi_strnicmp="no"
1748 if test "$tst_compi_strnicmp" = "yes"; then
1749 AC_MSG_CHECKING([if strnicmp usage allowed])
1750 if test "x$curl_disallow_strnicmp" != "xyes"; then
1751 AC_MSG_RESULT([yes])
1752 tst_allow_strnicmp="yes"
1755 tst_allow_strnicmp="no"
1759 AC_MSG_CHECKING([if strnicmp might be used])
1760 if test "$tst_links_strnicmp" = "yes" &&
1761 test "$tst_proto_strnicmp" = "yes" &&
1762 test "$tst_compi_strnicmp" = "yes" &&
1763 test "$tst_allow_strnicmp" = "yes"; then
1764 AC_MSG_RESULT([yes])
1765 AC_DEFINE_UNQUOTED(HAVE_STRNICMP, 1,
1766 [Define to 1 if you have the strnicmp function.])
1767 ac_cv_func_strnicmp="yes"
1770 ac_cv_func_strnicmp="no"
1775 dnl CURL_CHECK_FUNC_STRSTR
1776 dnl -------------------------------------------------
1777 dnl Verify if strstr is available, prototyped, and
1778 dnl can be compiled. If all of these are true, and
1779 dnl usage has not been previously disallowed with
1780 dnl shell variable curl_disallow_strstr, then
1781 dnl HAVE_STRSTR will be defined.
1783 AC_DEFUN([CURL_CHECK_FUNC_STRSTR], [
1784 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
1786 tst_links_strstr="unknown"
1787 tst_proto_strstr="unknown"
1788 tst_compi_strstr="unknown"
1789 tst_allow_strstr="unknown"
1791 AC_MSG_CHECKING([if strstr can be linked])
1793 AC_LANG_FUNC_LINK_TRY([strstr])
1795 AC_MSG_RESULT([yes])
1796 tst_links_strstr="yes"
1799 tst_links_strstr="no"
1802 if test "$tst_links_strstr" = "yes"; then
1803 AC_MSG_CHECKING([if strstr is prototyped])
1804 AC_EGREP_CPP([strstr],[
1805 $curl_includes_string
1807 AC_MSG_RESULT([yes])
1808 tst_proto_strstr="yes"
1811 tst_proto_strstr="no"
1815 if test "$tst_proto_strstr" = "yes"; then
1816 AC_MSG_CHECKING([if strstr is compilable])
1819 $curl_includes_string
1821 if(0 != strstr(0, 0))
1825 AC_MSG_RESULT([yes])
1826 tst_compi_strstr="yes"
1829 tst_compi_strstr="no"
1833 if test "$tst_compi_strstr" = "yes"; then
1834 AC_MSG_CHECKING([if strstr usage allowed])
1835 if test "x$curl_disallow_strstr" != "xyes"; then
1836 AC_MSG_RESULT([yes])
1837 tst_allow_strstr="yes"
1840 tst_allow_strstr="no"
1844 AC_MSG_CHECKING([if strstr might be used])
1845 if test "$tst_links_strstr" = "yes" &&
1846 test "$tst_proto_strstr" = "yes" &&
1847 test "$tst_compi_strstr" = "yes" &&
1848 test "$tst_allow_strstr" = "yes"; then
1849 AC_MSG_RESULT([yes])
1850 AC_DEFINE_UNQUOTED(HAVE_STRSTR, 1,
1851 [Define to 1 if you have the strstr function.])
1852 ac_cv_func_strstr="yes"
1855 ac_cv_func_strstr="no"
1860 dnl CURL_CHECK_FUNC_STRTOK_R
1861 dnl -------------------------------------------------
1862 dnl Verify if strtok_r is available, prototyped, and
1863 dnl can be compiled. If all of these are true, and
1864 dnl usage has not been previously disallowed with
1865 dnl shell variable curl_disallow_strtok_r, then
1866 dnl HAVE_STRTOK_R will be defined.
1868 AC_DEFUN([CURL_CHECK_FUNC_STRTOK_R], [
1869 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
1871 tst_links_strtok_r="unknown"
1872 tst_proto_strtok_r="unknown"
1873 tst_compi_strtok_r="unknown"
1874 tst_allow_strtok_r="unknown"
1876 AC_MSG_CHECKING([if strtok_r can be linked])
1878 AC_LANG_FUNC_LINK_TRY([strtok_r])
1880 AC_MSG_RESULT([yes])
1881 tst_links_strtok_r="yes"
1884 tst_links_strtok_r="no"
1887 if test "$tst_links_strtok_r" = "yes"; then
1888 AC_MSG_CHECKING([if strtok_r is prototyped])
1889 AC_EGREP_CPP([strtok_r],[
1890 $curl_includes_string
1892 AC_MSG_RESULT([yes])
1893 tst_proto_strtok_r="yes"
1896 tst_proto_strtok_r="no"
1900 if test "$tst_proto_strtok_r" = "yes"; then
1901 AC_MSG_CHECKING([if strtok_r is compilable])
1904 $curl_includes_string
1906 if(0 != strtok_r(0, 0, 0))
1910 AC_MSG_RESULT([yes])
1911 tst_compi_strtok_r="yes"
1914 tst_compi_strtok_r="no"
1918 if test "$tst_compi_strtok_r" = "yes"; then
1919 AC_MSG_CHECKING([if strtok_r usage allowed])
1920 if test "x$curl_disallow_strtok_r" != "xyes"; then
1921 AC_MSG_RESULT([yes])
1922 tst_allow_strtok_r="yes"
1925 tst_allow_strtok_r="no"
1929 AC_MSG_CHECKING([if strtok_r might be used])
1930 if test "$tst_links_strtok_r" = "yes" &&
1931 test "$tst_proto_strtok_r" = "yes" &&
1932 test "$tst_compi_strtok_r" = "yes" &&
1933 test "$tst_allow_strtok_r" = "yes"; then
1934 AC_MSG_RESULT([yes])
1935 AC_DEFINE_UNQUOTED(HAVE_STRTOK_R, 1,
1936 [Define to 1 if you have the strtok_r function.])
1937 ac_cv_func_strtok_r="yes"
1940 ac_cv_func_strtok_r="no"
1945 dnl CURL_CHECK_FUNC_STRTOLL
1946 dnl -------------------------------------------------
1947 dnl Verify if strtoll is available, prototyped, and
1948 dnl can be compiled. If all of these are true, and
1949 dnl usage has not been previously disallowed with
1950 dnl shell variable curl_disallow_strtoll, then
1951 dnl HAVE_STRTOLL will be defined.
1953 AC_DEFUN([CURL_CHECK_FUNC_STRTOLL], [
1954 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
1956 tst_links_strtoll="unknown"
1957 tst_proto_strtoll="unknown"
1958 tst_compi_strtoll="unknown"
1959 tst_allow_strtoll="unknown"
1961 AC_MSG_CHECKING([if strtoll can be linked])
1963 AC_LANG_FUNC_LINK_TRY([strtoll])
1965 AC_MSG_RESULT([yes])
1966 tst_links_strtoll="yes"
1969 tst_links_strtoll="no"
1972 if test "$tst_links_strtoll" = "yes"; then
1973 AC_MSG_CHECKING([if strtoll is prototyped])
1974 AC_EGREP_CPP([strtoll],[
1975 $curl_includes_stdlib
1977 AC_MSG_RESULT([yes])
1978 tst_proto_strtoll="yes"
1981 tst_proto_strtoll="no"
1985 if test "$tst_proto_strtoll" = "yes"; then
1986 AC_MSG_CHECKING([if strtoll is compilable])
1989 $curl_includes_stdlib
1991 if(0 != strtoll(0, 0, 0))
1995 AC_MSG_RESULT([yes])
1996 tst_compi_strtoll="yes"
1999 tst_compi_strtoll="no"
2003 if test "$tst_compi_strtoll" = "yes"; then
2004 AC_MSG_CHECKING([if strtoll usage allowed])
2005 if test "x$curl_disallow_strtoll" != "xyes"; then
2006 AC_MSG_RESULT([yes])
2007 tst_allow_strtoll="yes"
2010 tst_allow_strtoll="no"
2014 AC_MSG_CHECKING([if strtoll might be used])
2015 if test "$tst_links_strtoll" = "yes" &&
2016 test "$tst_proto_strtoll" = "yes" &&
2017 test "$tst_compi_strtoll" = "yes" &&
2018 test "$tst_allow_strtoll" = "yes"; then
2019 AC_MSG_RESULT([yes])
2020 AC_DEFINE_UNQUOTED(HAVE_STRTOLL, 1,
2021 [Define to 1 if you have the strtoll function.])
2022 ac_cv_func_strtoll="yes"
2025 ac_cv_func_strtoll="no"
2030 dnl CURL_CHECK_FUNC_WRITEV
2031 dnl -------------------------------------------------
2032 dnl Verify if writev is available, prototyped, and
2033 dnl can be compiled. If all of these are true, and
2034 dnl usage has not been previously disallowed with
2035 dnl shell variable curl_disallow_writev, then
2036 dnl HAVE_WRITEV will be defined.
2038 AC_DEFUN([CURL_CHECK_FUNC_WRITEV], [
2039 AC_REQUIRE([CURL_INCLUDES_SYS_UIO])dnl
2041 tst_links_writev="unknown"
2042 tst_proto_writev="unknown"
2043 tst_compi_writev="unknown"
2044 tst_allow_writev="unknown"
2046 AC_MSG_CHECKING([if writev can be linked])
2048 AC_LANG_FUNC_LINK_TRY([writev])
2050 AC_MSG_RESULT([yes])
2051 tst_links_writev="yes"
2054 tst_links_writev="no"
2057 if test "$tst_links_writev" = "yes"; then
2058 AC_MSG_CHECKING([if writev is prototyped])
2059 AC_EGREP_CPP([writev],[
2060 $curl_includes_sys_uio
2062 AC_MSG_RESULT([yes])
2063 tst_proto_writev="yes"
2066 tst_proto_writev="no"
2070 if test "$tst_proto_writev" = "yes"; then
2071 AC_MSG_CHECKING([if writev is compilable])
2074 $curl_includes_sys_uio
2076 if(0 != writev(0, 0, 0))
2080 AC_MSG_RESULT([yes])
2081 tst_compi_writev="yes"
2084 tst_compi_writev="no"
2088 if test "$tst_compi_writev" = "yes"; then
2089 AC_MSG_CHECKING([if writev usage allowed])
2090 if test "x$curl_disallow_writev" != "xyes"; then
2091 AC_MSG_RESULT([yes])
2092 tst_allow_writev="yes"
2095 tst_allow_writev="no"
2099 AC_MSG_CHECKING([if writev might be used])
2100 if test "$tst_links_writev" = "yes" &&
2101 test "$tst_proto_writev" = "yes" &&
2102 test "$tst_compi_writev" = "yes" &&
2103 test "$tst_allow_writev" = "yes"; then
2104 AC_MSG_RESULT([yes])
2105 AC_DEFINE_UNQUOTED(HAVE_WRITEV, 1,
2106 [Define to 1 if you have the writev function.])
2107 ac_cv_func_writev="yes"
2110 ac_cv_func_writev="no"