1 #***************************************************************************
3 # Project ___| | | | _ \| |
5 # | (__| |_| | _ <| |___
6 # \___|\___/|_| \_\_____|
8 # Copyright (C) 1998 - 2009, 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 #***************************************************************************
25 dnl CURL_CHECK_COMPILER_HALT_ON_ERROR
26 dnl -------------------------------------------------
27 dnl Verifies if the compiler actually halts after the
28 dnl compilation phase without generating any object
29 dnl code file, when the source compiles with errors.
31 AC_DEFUN([CURL_CHECK_COMPILER_HALT_ON_ERROR], [
32 AC_MSG_CHECKING([if compiler halts on compilation errors])
36 force compilation error
40 AC_MSG_ERROR([compiler does not halt on compilation errors.])
47 dnl CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
48 dnl -------------------------------------------------
49 dnl Verifies if the compiler actually halts after the
50 dnl compilation phase without generating any object
51 dnl code file, when the source code tries to define a
52 dnl type for a constant array with negative dimension.
54 AC_DEFUN([CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE], [
55 AC_REQUIRE([CURL_CHECK_COMPILER_HALT_ON_ERROR])dnl
56 AC_MSG_CHECKING([if compiler halts on negative sized arrays])
59 typedef char bad_t[sizeof(char) == sizeof(int) ? -1 : -1 ];
65 AC_MSG_ERROR([compiler does not halt on negative sized arrays.])
72 dnl CURL_CHECK_DEF (SYMBOL, [INCLUDES], [SILENT])
73 dnl -------------------------------------------------
74 dnl Use the C preprocessor to find out if the given object-style symbol
75 dnl is defined and get its expansion. This macro will not use default
76 dnl includes even if no INCLUDES argument is given. This macro will run
77 dnl silently when invoked with three arguments. If the expansion would
78 dnl result in a set of double-quoted strings the returned expansion will
79 dnl actually be a single double-quoted string concatenating all them.
81 AC_DEFUN([CURL_CHECK_DEF], [
82 AS_VAR_PUSHDEF([ac_HaveDef], [curl_cv_have_def_$1])dnl
83 AS_VAR_PUSHDEF([ac_Def], [curl_cv_def_$1])dnl
84 if test -z "$SED"; then
85 AC_MSG_ERROR([SED not set. Cannot continue without SED being set.])
87 if test -z "$GREP"; then
88 AC_MSG_ERROR([GREP not set. Cannot continue without GREP being set.])
90 ifelse($3,,[AC_MSG_CHECKING([for preprocessor definition of $1])])
100 tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \
101 "$GREP" CURL_DEF_TOKEN 2>/dev/null | \
102 "$SED" 's/.*CURL_DEF_TOKEN[[ ]]//' 2>/dev/null | \
103 "$SED" 's/[["]][[ ]]*[["]]//g' 2>/dev/null`
104 if test -z "$tmp_exp" || test "$tmp_exp" = "$1"; then
108 if test -z "$tmp_exp"; then
109 AS_VAR_SET(ac_HaveDef, no)
110 ifelse($3,,[AC_MSG_RESULT([no])])
112 AS_VAR_SET(ac_HaveDef, yes)
113 AS_VAR_SET(ac_Def, $tmp_exp)
114 ifelse($3,,[AC_MSG_RESULT([$tmp_exp])])
116 AS_VAR_POPDEF([ac_Def])dnl
117 AS_VAR_POPDEF([ac_HaveDef])dnl
121 dnl CURL_CHECK_AIX_ALL_SOURCE
122 dnl -------------------------------------------------
123 dnl Provides a replacement of traditional AC_AIX with
124 dnl an uniform behaviour across all autoconf versions,
125 dnl and with our own placement rules.
127 AC_DEFUN([CURL_CHECK_AIX_ALL_SOURCE], [
128 AH_VERBATIM([_ALL_SOURCE],
129 [/* Define to 1 if OS is AIX. */
133 AC_BEFORE([$0], [AC_SYS_LARGEFILE])dnl
134 AC_BEFORE([$0], [CURL_CONFIGURE_REENTRANT])dnl
135 AC_MSG_CHECKING([if OS is AIX (to define _ALL_SOURCE)])
136 AC_EGREP_CPP([yes_this_is_aix],[
142 AC_DEFINE(_ALL_SOURCE)
149 dnl CURL_CHECK_HEADER_WINDOWS
150 dnl -------------------------------------------------
151 dnl Check for compilable and valid windows.h header
153 AC_DEFUN([CURL_CHECK_HEADER_WINDOWS], [
154 AC_CACHE_CHECK([for windows.h], [ac_cv_header_windows_h], [
158 #ifndef WIN32_LEAN_AND_MEAN
159 #define WIN32_LEAN_AND_MEAN
163 #if defined(__CYGWIN__) || defined(__CEGCC__)
164 HAVE_WINDOWS_H shall not be defined.
170 ac_cv_header_windows_h="yes"
172 ac_cv_header_windows_h="no"
175 case "$ac_cv_header_windows_h" in
177 AC_DEFINE_UNQUOTED(HAVE_WINDOWS_H, 1,
178 [Define to 1 if you have the windows.h header file.])
179 AC_DEFINE_UNQUOTED(WIN32_LEAN_AND_MEAN, 1,
180 [Define to avoid automatic inclusion of winsock.h])
186 dnl CURL_CHECK_NATIVE_WINDOWS
187 dnl -------------------------------------------------
188 dnl Check if building a native Windows target
190 AC_DEFUN([CURL_CHECK_NATIVE_WINDOWS], [
191 AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
192 AC_CACHE_CHECK([whether build target is a native Windows one], [ac_cv_native_windows], [
193 if test "$ac_cv_header_windows_h" = "no"; then
194 ac_cv_native_windows="no"
199 #if defined(__MINGW32__) || defined(__MINGW32CE__) || \
200 (defined(_MSC_VER) && (defined(_WIN32) || defined(_WIN64)))
203 Not a native Windows build target.
207 ac_cv_native_windows="yes"
209 ac_cv_native_windows="no"
213 case "$ac_cv_native_windows" in
215 AC_DEFINE_UNQUOTED(NATIVE_WINDOWS, 1,
216 [Define to 1 if you are building a native Windows target.])
222 dnl CURL_CHECK_HEADER_WINSOCK
223 dnl -------------------------------------------------
224 dnl Check for compilable and valid winsock.h header
226 AC_DEFUN([CURL_CHECK_HEADER_WINSOCK], [
227 AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
228 AC_CACHE_CHECK([for winsock.h], [ac_cv_header_winsock_h], [
232 #ifndef WIN32_LEAN_AND_MEAN
233 #define WIN32_LEAN_AND_MEAN
238 #if defined(__CYGWIN__) || defined(__CEGCC__)
239 HAVE_WINSOCK_H shall not be defined.
241 int dummy=WSACleanup();
245 ac_cv_header_winsock_h="yes"
247 ac_cv_header_winsock_h="no"
250 case "$ac_cv_header_winsock_h" in
252 AC_DEFINE_UNQUOTED(HAVE_WINSOCK_H, 1,
253 [Define to 1 if you have the winsock.h header file.])
259 dnl CURL_CHECK_HEADER_WINSOCK2
260 dnl -------------------------------------------------
261 dnl Check for compilable and valid winsock2.h header
263 AC_DEFUN([CURL_CHECK_HEADER_WINSOCK2], [
264 AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
265 AC_CACHE_CHECK([for winsock2.h], [ac_cv_header_winsock2_h], [
269 #ifndef WIN32_LEAN_AND_MEAN
270 #define WIN32_LEAN_AND_MEAN
273 #include <winsock2.h>
275 #if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__)
276 HAVE_WINSOCK2_H shall not be defined.
278 int dummy=2*IPPROTO_ESP;
282 ac_cv_header_winsock2_h="yes"
284 ac_cv_header_winsock2_h="no"
287 case "$ac_cv_header_winsock2_h" in
289 AC_DEFINE_UNQUOTED(HAVE_WINSOCK2_H, 1,
290 [Define to 1 if you have the winsock2.h header file.])
296 dnl CURL_CHECK_HEADER_WS2TCPIP
297 dnl -------------------------------------------------
298 dnl Check for compilable and valid ws2tcpip.h header
300 AC_DEFUN([CURL_CHECK_HEADER_WS2TCPIP], [
301 AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
302 AC_CACHE_CHECK([for ws2tcpip.h], [ac_cv_header_ws2tcpip_h], [
306 #ifndef WIN32_LEAN_AND_MEAN
307 #define WIN32_LEAN_AND_MEAN
310 #include <winsock2.h>
311 #include <ws2tcpip.h>
313 #if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__)
314 HAVE_WS2TCPIP_H shall not be defined.
316 int dummy=2*IP_PKTINFO;
320 ac_cv_header_ws2tcpip_h="yes"
322 ac_cv_header_ws2tcpip_h="no"
325 case "$ac_cv_header_ws2tcpip_h" in
327 AC_DEFINE_UNQUOTED(HAVE_WS2TCPIP_H, 1,
328 [Define to 1 if you have the ws2tcpip.h header file.])
334 dnl CURL_CHECK_HEADER_WINLDAP
335 dnl -------------------------------------------------
336 dnl Check for compilable and valid winldap.h header
338 AC_DEFUN([CURL_CHECK_HEADER_WINLDAP], [
339 AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
340 AC_CACHE_CHECK([for winldap.h], [ac_cv_header_winldap_h], [
344 #ifdef HAVE_WINDOWS_H
345 #ifndef WIN32_LEAN_AND_MEAN
346 #define WIN32_LEAN_AND_MEAN
352 #if defined(__CYGWIN__) || defined(__CEGCC__)
353 HAVE_WINLDAP_H shall not be defined.
355 LDAP *ldp = ldap_init("dummy", LDAP_PORT);
356 ULONG res = ldap_unbind(ldp);
360 ac_cv_header_winldap_h="yes"
362 ac_cv_header_winldap_h="no"
365 case "$ac_cv_header_winldap_h" in
367 AC_DEFINE_UNQUOTED(HAVE_WINLDAP_H, 1,
368 [Define to 1 if you have the winldap.h header file.])
374 dnl CURL_CHECK_HEADER_WINBER
375 dnl -------------------------------------------------
376 dnl Check for compilable and valid winber.h header
378 AC_DEFUN([CURL_CHECK_HEADER_WINBER], [
379 AC_REQUIRE([CURL_CHECK_HEADER_WINLDAP])dnl
380 AC_CACHE_CHECK([for winber.h], [ac_cv_header_winber_h], [
384 #ifdef HAVE_WINDOWS_H
385 #ifndef WIN32_LEAN_AND_MEAN
386 #define WIN32_LEAN_AND_MEAN
393 #if defined(__CYGWIN__) || defined(__CEGCC__)
394 HAVE_WINBER_H shall not be defined.
397 BerElement *bep = ber_init(bvp);
402 ac_cv_header_winber_h="yes"
404 ac_cv_header_winber_h="no"
407 case "$ac_cv_header_winber_h" in
409 AC_DEFINE_UNQUOTED(HAVE_WINBER_H, 1,
410 [Define to 1 if you have the winber.h header file.])
416 dnl CURL_CHECK_HEADER_LBER
417 dnl -------------------------------------------------
418 dnl Check for compilable and valid lber.h header,
419 dnl and check if it is needed even with ldap.h
421 AC_DEFUN([CURL_CHECK_HEADER_LBER], [
422 AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
423 AC_CACHE_CHECK([for lber.h], [ac_cv_header_lber_h], [
427 #ifdef HAVE_WINDOWS_H
428 #ifndef WIN32_LEAN_AND_MEAN
429 #define WIN32_LEAN_AND_MEAN
433 #ifdef HAVE_SYS_TYPES_H
434 #include <sys/types.h>
438 #define NULL (void *)0
442 BerValue *bvp = NULL;
443 BerElement *bep = ber_init(bvp);
447 ac_cv_header_lber_h="yes"
449 ac_cv_header_lber_h="no"
452 if test "$ac_cv_header_lber_h" = "yes"; then
453 AC_DEFINE_UNQUOTED(HAVE_LBER_H, 1,
454 [Define to 1 if you have the lber.h header file.])
459 #ifdef HAVE_WINDOWS_H
460 #ifndef WIN32_LEAN_AND_MEAN
461 #define WIN32_LEAN_AND_MEAN
465 #ifdef HAVE_SYS_TYPES_H
466 #include <sys/types.h>
470 #define NULL (void *)0
472 #ifndef LDAP_DEPRECATED
473 #define LDAP_DEPRECATED 1
477 BerValue *bvp = NULL;
478 BerElement *bep = ber_init(bvp);
482 curl_cv_need_header_lber_h="no"
484 curl_cv_need_header_lber_h="yes"
487 case "$curl_cv_need_header_lber_h" in
489 AC_DEFINE_UNQUOTED(NEED_LBER_H, 1,
490 [Define to 1 if you need the lber.h header file even with ldap.h])
497 dnl CURL_CHECK_HEADER_LDAP
498 dnl -------------------------------------------------
499 dnl Check for compilable and valid ldap.h header
501 AC_DEFUN([CURL_CHECK_HEADER_LDAP], [
502 AC_REQUIRE([CURL_CHECK_HEADER_LBER])dnl
503 AC_CACHE_CHECK([for ldap.h], [ac_cv_header_ldap_h], [
507 #ifdef HAVE_WINDOWS_H
508 #ifndef WIN32_LEAN_AND_MEAN
509 #define WIN32_LEAN_AND_MEAN
513 #ifdef HAVE_SYS_TYPES_H
514 #include <sys/types.h>
517 #ifndef LDAP_DEPRECATED
518 #define LDAP_DEPRECATED 1
525 LDAP *ldp = ldap_init("dummy", LDAP_PORT);
526 int res = ldap_unbind(ldp);
529 ac_cv_header_ldap_h="yes"
531 ac_cv_header_ldap_h="no"
534 case "$ac_cv_header_ldap_h" in
536 AC_DEFINE_UNQUOTED(HAVE_LDAP_H, 1,
537 [Define to 1 if you have the ldap.h header file.])
543 dnl CURL_CHECK_HEADER_LDAP_SSL
544 dnl -------------------------------------------------
545 dnl Check for compilable and valid ldap_ssl.h header
547 AC_DEFUN([CURL_CHECK_HEADER_LDAP_SSL], [
548 AC_REQUIRE([CURL_CHECK_HEADER_LDAP])dnl
549 AC_CACHE_CHECK([for ldap_ssl.h], [ac_cv_header_ldap_ssl_h], [
553 #ifdef HAVE_WINDOWS_H
554 #ifndef WIN32_LEAN_AND_MEAN
555 #define WIN32_LEAN_AND_MEAN
559 #ifdef HAVE_SYS_TYPES_H
560 #include <sys/types.h>
563 #ifndef LDAP_DEPRECATED
564 #define LDAP_DEPRECATED 1
572 #include <ldap_ssl.h>
574 LDAP *ldp = ldapssl_init("dummy", LDAPS_PORT, 1);
577 ac_cv_header_ldap_ssl_h="yes"
579 ac_cv_header_ldap_ssl_h="no"
582 case "$ac_cv_header_ldap_ssl_h" in
584 AC_DEFINE_UNQUOTED(HAVE_LDAP_SSL_H, 1,
585 [Define to 1 if you have the ldap_ssl.h header file.])
591 dnl CURL_CHECK_HEADER_LDAPSSL
592 dnl -------------------------------------------------
593 dnl Check for compilable and valid ldapssl.h header
595 AC_DEFUN([CURL_CHECK_HEADER_LDAPSSL], [
596 AC_REQUIRE([CURL_CHECK_HEADER_LDAP])dnl
597 AC_CACHE_CHECK([for ldapssl.h], [ac_cv_header_ldapssl_h], [
601 #ifdef HAVE_WINDOWS_H
602 #ifndef WIN32_LEAN_AND_MEAN
603 #define WIN32_LEAN_AND_MEAN
607 #ifdef HAVE_SYS_TYPES_H
608 #include <sys/types.h>
612 #define NULL (void *)0
614 #ifndef LDAP_DEPRECATED
615 #define LDAP_DEPRECATED 1
625 char *cert_label = NULL;
626 LDAP *ldp = ldap_ssl_init("dummy", LDAPS_PORT, cert_label);
629 ac_cv_header_ldapssl_h="yes"
631 ac_cv_header_ldapssl_h="no"
634 case "$ac_cv_header_ldapssl_h" in
636 AC_DEFINE_UNQUOTED(HAVE_LDAPSSL_H, 1,
637 [Define to 1 if you have the ldapssl.h header file.])
643 dnl CURL_CHECK_LIBS_WINLDAP
644 dnl -------------------------------------------------
645 dnl Check for libraries needed for WINLDAP support,
646 dnl and prepended to LIBS any needed libraries.
647 dnl This macro can take an optional parameter with a
648 dnl white space separated list of libraries to check
649 dnl before the WINLDAP default ones.
651 AC_DEFUN([CURL_CHECK_LIBS_WINLDAP], [
652 AC_REQUIRE([CURL_CHECK_HEADER_WINBER])dnl
654 AC_MSG_CHECKING([for WINLDAP libraries])
668 if test -z "$u_libs"; then
671 u_libs="$u_libs $l_lib"
676 curl_cv_save_LIBS="$LIBS"
677 curl_cv_ldap_LIBS="unknown"
679 for x_nlibs in '' "$u_libs" \
681 if test "$curl_cv_ldap_LIBS" = "unknown"; then
682 if test -z "$x_nlibs"; then
683 LIBS="$curl_cv_save_LIBS"
685 LIBS="$x_nlibs $curl_cv_save_LIBS"
690 #ifdef HAVE_WINDOWS_H
691 #ifndef WIN32_LEAN_AND_MEAN
692 #define WIN32_LEAN_AND_MEAN
695 #ifdef HAVE_WINLDAP_H
704 BerElement *bep = ber_init(bvp);
705 LDAP *ldp = ldap_init("dummy", LDAP_PORT);
706 ULONG res = ldap_unbind(ldp);
710 curl_cv_ldap_LIBS="$x_nlibs"
715 LIBS="$curl_cv_save_LIBS"
717 case X-"$curl_cv_ldap_LIBS" in
719 AC_MSG_RESULT([cannot find WINLDAP libraries])
722 AC_MSG_RESULT([no additional lib required])
725 if test -z "$curl_cv_save_LIBS"; then
726 LIBS="$curl_cv_ldap_LIBS"
728 LIBS="$curl_cv_ldap_LIBS $curl_cv_save_LIBS"
730 AC_MSG_RESULT([$curl_cv_ldap_LIBS])
737 dnl CURL_CHECK_LIBS_LDAP
738 dnl -------------------------------------------------
739 dnl Check for libraries needed for LDAP support,
740 dnl and prepended to LIBS any needed libraries.
741 dnl This macro can take an optional parameter with a
742 dnl white space separated list of libraries to check
743 dnl before the default ones.
745 AC_DEFUN([CURL_CHECK_LIBS_LDAP], [
746 AC_REQUIRE([CURL_CHECK_HEADER_LDAP])dnl
748 AC_MSG_CHECKING([for LDAP libraries])
762 if test -z "$u_libs"; then
765 u_libs="$u_libs $l_lib"
770 curl_cv_save_LIBS="$LIBS"
771 curl_cv_ldap_LIBS="unknown"
773 for x_nlibs in '' "$u_libs" \
777 '-lldapssl -lldapx -lldapsdk' \
778 '-lldapsdk -lldapx -lldapssl' ; do
779 if test "$curl_cv_ldap_LIBS" = "unknown"; then
780 if test -z "$x_nlibs"; then
781 LIBS="$curl_cv_save_LIBS"
783 LIBS="$x_nlibs $curl_cv_save_LIBS"
788 #ifdef HAVE_WINDOWS_H
789 #ifndef WIN32_LEAN_AND_MEAN
790 #define WIN32_LEAN_AND_MEAN
794 #ifdef HAVE_SYS_TYPES_H
795 #include <sys/types.h>
799 #define NULL (void *)0
801 #ifndef LDAP_DEPRECATED
802 #define LDAP_DEPRECATED 1
811 BerValue *bvp = NULL;
812 BerElement *bep = ber_init(bvp);
813 LDAP *ldp = ldap_init("dummy", LDAP_PORT);
814 int res = ldap_unbind(ldp);
818 curl_cv_ldap_LIBS="$x_nlibs"
823 LIBS="$curl_cv_save_LIBS"
825 case X-"$curl_cv_ldap_LIBS" in
827 AC_MSG_RESULT([cannot find LDAP libraries])
830 AC_MSG_RESULT([no additional lib required])
833 if test -z "$curl_cv_save_LIBS"; then
834 LIBS="$curl_cv_ldap_LIBS"
836 LIBS="$curl_cv_ldap_LIBS $curl_cv_save_LIBS"
838 AC_MSG_RESULT([$curl_cv_ldap_LIBS])
845 dnl CURL_CHECK_HEADER_MALLOC
846 dnl -------------------------------------------------
847 dnl Check for compilable and valid malloc.h header,
848 dnl and check if it is needed even with stdlib.h
850 AC_DEFUN([CURL_CHECK_HEADER_MALLOC], [
851 AC_CACHE_CHECK([for malloc.h], [ac_cv_header_malloc_h], [
856 void *p = malloc(10);
857 void *q = calloc(10,10);
862 ac_cv_header_malloc_h="yes"
864 ac_cv_header_malloc_h="no"
867 if test "$ac_cv_header_malloc_h" = "yes"; then
868 AC_DEFINE_UNQUOTED(HAVE_MALLOC_H, 1,
869 [Define to 1 if you have the malloc.h header file.])
875 void *p = malloc(10);
876 void *q = calloc(10,10);
881 curl_cv_need_header_malloc_h="no"
883 curl_cv_need_header_malloc_h="yes"
886 case "$curl_cv_need_header_malloc_h" in
888 AC_DEFINE_UNQUOTED(NEED_MALLOC_H, 1,
889 [Define to 1 if you need the malloc.h header file even with stdlib.h])
896 dnl CURL_CHECK_HEADER_MEMORY
897 dnl -------------------------------------------------
898 dnl Check for compilable and valid memory.h header,
899 dnl and check if it is needed even with stdlib.h for
900 dnl memory related functions.
902 AC_DEFUN([CURL_CHECK_HEADER_MEMORY], [
903 AC_CACHE_CHECK([for memory.h], [ac_cv_header_memory_h], [
908 void *p = malloc(10);
909 void *q = calloc(10,10);
914 ac_cv_header_memory_h="yes"
916 ac_cv_header_memory_h="no"
919 if test "$ac_cv_header_memory_h" = "yes"; then
920 AC_DEFINE_UNQUOTED(HAVE_MEMORY_H, 1,
921 [Define to 1 if you have the memory.h header file.])
927 void *p = malloc(10);
928 void *q = calloc(10,10);
933 curl_cv_need_header_memory_h="no"
935 curl_cv_need_header_memory_h="yes"
938 case "$curl_cv_need_header_memory_h" in
940 AC_DEFINE_UNQUOTED(NEED_MEMORY_H, 1,
941 [Define to 1 if you need the memory.h header file even with stdlib.h])
948 dnl CURL_CHECK_TYPE_SOCKLEN_T
949 dnl -------------------------------------------------
950 dnl Check for existing socklen_t type, and provide
951 dnl an equivalent type if socklen_t not available
953 AC_DEFUN([CURL_CHECK_TYPE_SOCKLEN_T], [
954 AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl
955 AC_CHECK_TYPE([socklen_t], ,[
956 dnl socklen_t not available
957 AC_CACHE_CHECK([for socklen_t equivalent],
958 [curl_cv_socklen_t_equiv], [
959 curl_cv_socklen_t_equiv="unknown"
960 for arg1 in 'int' 'SOCKET'; do
961 for arg2 in "struct sockaddr" void; do
962 for t in int size_t unsigned long "unsigned long"; do
963 if test "$curl_cv_socklen_t_equiv" = "unknown"; then
967 #ifdef HAVE_WINDOWS_H
968 #ifndef WIN32_LEAN_AND_MEAN
969 #define WIN32_LEAN_AND_MEAN
972 #ifdef HAVE_WINSOCK2_H
973 #include <winsock2.h>
975 #ifdef HAVE_WINSOCK_H
979 #define GETPEERNCALLCONV PASCAL
981 #ifdef HAVE_SYS_TYPES_H
982 #include <sys/types.h>
984 #ifdef HAVE_SYS_SOCKET_H
985 #include <sys/socket.h>
987 #define GETPEERNCALLCONV
989 extern int GETPEERNCALLCONV getpeername($arg1, $arg2 *, $t *);
992 getpeername(0,0,&len);
995 curl_cv_socklen_t_equiv="$t"
1002 case "$curl_cv_socklen_t_equiv" in
1004 AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
1007 AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv,
1008 [Type to use in place of socklen_t when system does not provide it.])
1013 #ifdef HAVE_WINDOWS_H
1014 #ifndef WIN32_LEAN_AND_MEAN
1015 #define WIN32_LEAN_AND_MEAN
1017 #include <windows.h>
1018 #ifdef HAVE_WINSOCK2_H
1019 #include <winsock2.h>
1020 #ifdef HAVE_WS2TCPIP_H
1021 #include <ws2tcpip.h>
1025 #ifdef HAVE_SYS_TYPES_H
1026 #include <sys/types.h>
1028 #ifdef HAVE_SYS_SOCKET_H
1029 #include <sys/socket.h>
1036 dnl CURL_CHECK_FUNC_GETNAMEINFO
1037 dnl -------------------------------------------------
1038 dnl Test if the getnameinfo function is available,
1039 dnl and check the types of five of its arguments.
1040 dnl If the function succeeds HAVE_GETNAMEINFO will be
1041 dnl defined, defining the types of the arguments in
1042 dnl GETNAMEINFO_TYPE_ARG1, GETNAMEINFO_TYPE_ARG2,
1043 dnl GETNAMEINFO_TYPE_ARG46 and GETNAMEINFO_TYPE_ARG7,
1044 dnl and also defining the type qualifier of first
1045 dnl argument in GETNAMEINFO_QUAL_ARG1.
1047 AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [
1048 AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl
1049 AC_REQUIRE([CURL_CHECK_TYPE_SOCKLEN_T])dnl
1050 AC_CHECK_HEADERS(sys/types.h sys/socket.h netdb.h)
1052 AC_MSG_CHECKING([for getnameinfo])
1054 AC_LANG_FUNC_LINK_TRY([getnameinfo])
1056 AC_MSG_RESULT([yes])
1057 curl_cv_getnameinfo="yes"
1060 curl_cv_getnameinfo="no"
1063 if test "$curl_cv_getnameinfo" != "yes"; then
1064 AC_MSG_CHECKING([deeper for getnameinfo])
1071 AC_MSG_RESULT([yes])
1072 curl_cv_getnameinfo="yes"
1074 AC_MSG_RESULT([but still no])
1075 curl_cv_getnameinfo="no"
1079 if test "$curl_cv_getnameinfo" != "yes"; then
1080 AC_MSG_CHECKING([deeper and deeper for getnameinfo])
1084 #ifdef HAVE_WINDOWS_H
1085 #ifndef WIN32_LEAN_AND_MEAN
1086 #define WIN32_LEAN_AND_MEAN
1088 #include <windows.h>
1089 #ifdef HAVE_WINSOCK2_H
1090 #include <winsock2.h>
1091 #ifdef HAVE_WS2TCPIP_H
1092 #include <ws2tcpip.h>
1096 #ifdef HAVE_SYS_TYPES_H
1097 #include <sys/types.h>
1099 #ifdef HAVE_SYS_SOCKET_H
1100 #include <sys/socket.h>
1107 getnameinfo(0, 0, 0, 0, 0, 0, 0);
1110 AC_MSG_RESULT([yes])
1111 curl_cv_getnameinfo="yes"
1113 AC_MSG_RESULT([but still no])
1114 curl_cv_getnameinfo="no"
1118 if test "$curl_cv_getnameinfo" = "yes"; then
1119 AC_CACHE_CHECK([types of arguments for getnameinfo],
1120 [curl_cv_func_getnameinfo_args], [
1121 curl_cv_func_getnameinfo_args="unknown"
1122 for gni_arg1 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
1123 for gni_arg2 in 'socklen_t' 'size_t' 'int'; do
1124 for gni_arg46 in 'size_t' 'int' 'socklen_t' 'unsigned int' 'DWORD'; do
1125 for gni_arg7 in 'int' 'unsigned int'; do
1126 if test "$curl_cv_func_getnameinfo_args" = "unknown"; then
1130 #ifdef HAVE_WINDOWS_H
1131 #ifndef WIN32_LEAN_AND_MEAN
1132 #define WIN32_LEAN_AND_MEAN
1134 #if (!defined(_WIN32_WINNT)) || (_WIN32_WINNT < 0x0501)
1136 #define _WIN32_WINNT 0x0501
1138 #include <windows.h>
1139 #ifdef HAVE_WINSOCK2_H
1140 #include <winsock2.h>
1141 #ifdef HAVE_WS2TCPIP_H
1142 #include <ws2tcpip.h>
1145 #define GNICALLCONV WSAAPI
1147 #ifdef HAVE_SYS_TYPES_H
1148 #include <sys/types.h>
1150 #ifdef HAVE_SYS_SOCKET_H
1151 #include <sys/socket.h>
1158 extern int GNICALLCONV getnameinfo($gni_arg1, $gni_arg2,
1164 $gni_arg46 hostlen=0;
1165 $gni_arg46 servlen=0;
1167 int res = getnameinfo(0, salen, 0, hostlen, 0, servlen, flags);
1170 curl_cv_func_getnameinfo_args="$gni_arg1,$gni_arg2,$gni_arg46,$gni_arg7"
1178 if test "$curl_cv_func_getnameinfo_args" = "unknown"; then
1179 AC_MSG_WARN([Cannot find proper types to use for getnameinfo args])
1180 AC_MSG_WARN([HAVE_GETNAMEINFO will not be defined])
1182 gni_prev_IFS=$IFS; IFS=','
1183 set dummy `echo "$curl_cv_func_getnameinfo_args" | sed 's/\*/\*/g'`
1187 gni_qual_type_arg1=$[1]
1189 AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG2, $[2],
1190 [Define to the type of arg 2 for getnameinfo.])
1191 AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG46, $[3],
1192 [Define to the type of args 4 and 6 for getnameinfo.])
1193 AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG7, $[4],
1194 [Define to the type of arg 7 for getnameinfo.])
1198 case $prev_sh_opts in
1206 case "$gni_qual_type_arg1" in
1209 gni_type_arg1=`echo $gni_qual_type_arg1 | sed 's/^const //'`
1213 gni_type_arg1=$gni_qual_type_arg1
1217 AC_DEFINE_UNQUOTED(GETNAMEINFO_QUAL_ARG1, $gni_qual_arg1,
1218 [Define to the type qualifier of arg 1 for getnameinfo.])
1219 AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG1, $gni_type_arg1,
1220 [Define to the type of arg 1 for getnameinfo.])
1222 case $prev_sh_opts in
1230 AC_DEFINE_UNQUOTED(HAVE_GETNAMEINFO, 1,
1231 [Define to 1 if you have the getnameinfo function.])
1232 ac_cv_func_getnameinfo="yes"
1238 dnl TYPE_SOCKADDR_STORAGE
1239 dnl -------------------------------------------------
1240 dnl Check for struct sockaddr_storage. Most IPv6-enabled
1241 dnl hosts have it, but AIX 4.3 is one known exception.
1243 AC_DEFUN([TYPE_SOCKADDR_STORAGE],
1245 AC_CHECK_TYPE([struct sockaddr_storage],
1246 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1,
1247 [if struct sockaddr_storage is defined]), ,
1250 #ifdef HAVE_WINDOWS_H
1251 #ifndef WIN32_LEAN_AND_MEAN
1252 #define WIN32_LEAN_AND_MEAN
1254 #include <windows.h>
1255 #ifdef HAVE_WINSOCK2_H
1256 #include <winsock2.h>
1259 #ifdef HAVE_SYS_TYPES_H
1260 #include <sys/types.h>
1262 #ifdef HAVE_SYS_SOCKET_H
1263 #include <sys/socket.h>
1265 #ifdef HAVE_NETINET_IN_H
1266 #include <netinet/in.h>
1268 #ifdef HAVE_ARPA_INET_H
1269 #include <arpa/inet.h>
1276 dnl CURL_CHECK_NI_WITHSCOPEID
1277 dnl -------------------------------------------------
1278 dnl Check for working NI_WITHSCOPEID in getnameinfo()
1280 AC_DEFUN([CURL_CHECK_NI_WITHSCOPEID], [
1281 AC_REQUIRE([CURL_CHECK_FUNC_GETNAMEINFO])dnl
1282 AC_REQUIRE([TYPE_SOCKADDR_STORAGE])dnl
1283 AC_CHECK_HEADERS(stdio.h sys/types.h sys/socket.h \
1284 netdb.h netinet/in.h arpa/inet.h)
1286 AC_CACHE_CHECK([for working NI_WITHSCOPEID],
1287 [ac_cv_working_ni_withscopeid], [
1290 #ifdef HAVE_STDLIB_H
1296 #ifdef HAVE_SYS_TYPES_H
1297 #include <sys/types.h>
1299 #ifdef HAVE_SYS_SOCKET_H
1300 #include <sys/socket.h>
1305 #ifdef HAVE_NETINET_IN_H
1306 #include <netinet/in.h>
1308 #ifdef HAVE_ARPA_INET_H
1309 #include <arpa/inet.h>
1312 #if defined(NI_WITHSCOPEID) && defined(HAVE_GETNAMEINFO)
1313 #ifdef HAVE_STRUCT_SOCKADDR_STORAGE
1314 struct sockaddr_storage sa;
1316 unsigned char sa[256];
1318 char hostbuf[NI_MAXHOST];
1320 GETNAMEINFO_TYPE_ARG2 salen = (GETNAMEINFO_TYPE_ARG2)sizeof(sa);
1321 GETNAMEINFO_TYPE_ARG46 hostlen = (GETNAMEINFO_TYPE_ARG46)sizeof(hostbuf);
1322 GETNAMEINFO_TYPE_ARG7 flags = NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID;
1323 int fd = socket(AF_INET6, SOCK_STREAM, 0);
1326 return 1; /* Error creating socket */
1328 rc = getsockname(fd, (GETNAMEINFO_TYPE_ARG1)&sa, &salen);
1330 perror("getsockname()");
1331 return 2; /* Error retrieving socket name */
1333 rc = getnameinfo((GETNAMEINFO_TYPE_ARG1)&sa, salen, hostbuf, hostlen, NULL, 0, flags);
1335 printf("rc = %s\n", gai_strerror(rc));
1336 return 3; /* Error translating socket address */
1338 return 0; /* Ok, NI_WITHSCOPEID works */
1340 return 4; /* Error, NI_WITHSCOPEID not defined or no getnameinfo() */
1342 ]]) # AC-LANG-PROGRAM
1344 # Exit code == 0. Program worked.
1345 ac_cv_working_ni_withscopeid="yes"
1347 # Exit code != 0. Program failed.
1348 ac_cv_working_ni_withscopeid="no"
1350 # Program is not run when cross-compiling. So we assume
1351 # NI_WITHSCOPEID will work if we are able to compile it.
1354 #include <sys/types.h>
1355 #include <sys/socket.h>
1358 unsigned int dummy= NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID;
1361 ac_cv_working_ni_withscopeid="yes"
1363 ac_cv_working_ni_withscopeid="no"
1364 ]) # AC-COMPILE-IFELSE
1367 case "$ac_cv_working_ni_withscopeid" in
1369 AC_DEFINE(HAVE_NI_WITHSCOPEID, 1,
1370 [Define to 1 if NI_WITHSCOPEID exists and works.])
1376 dnl CURL_CHECK_FUNC_RECV
1377 dnl -------------------------------------------------
1378 dnl Test if the socket recv() function is available,
1379 dnl and check its return type and the types of its
1380 dnl arguments. If the function succeeds HAVE_RECV
1381 dnl will be defined, defining the types of the arguments
1382 dnl in RECV_TYPE_ARG1, RECV_TYPE_ARG2, RECV_TYPE_ARG3
1383 dnl and RECV_TYPE_ARG4, defining the type of the function
1384 dnl return value in RECV_TYPE_RETV.
1386 AC_DEFUN([CURL_CHECK_FUNC_RECV], [
1387 AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl
1388 AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
1389 AC_CHECK_HEADERS(sys/types.h sys/socket.h)
1391 AC_MSG_CHECKING([for recv])
1395 #ifdef HAVE_WINDOWS_H
1396 #ifndef WIN32_LEAN_AND_MEAN
1397 #define WIN32_LEAN_AND_MEAN
1399 #include <windows.h>
1400 #ifdef HAVE_WINSOCK2_H
1401 #include <winsock2.h>
1403 #ifdef HAVE_WINSOCK_H
1404 #include <winsock.h>
1408 #ifdef HAVE_SYS_TYPES_H
1409 #include <sys/types.h>
1411 #ifdef HAVE_SYS_SOCKET_H
1412 #include <sys/socket.h>
1419 AC_MSG_RESULT([yes])
1426 if test "$curl_cv_recv" = "yes"; then
1427 AC_CACHE_CHECK([types of args and return type for recv],
1428 [curl_cv_func_recv_args], [
1429 curl_cv_func_recv_args="unknown"
1430 for recv_retv in 'int' 'ssize_t'; do
1431 for recv_arg1 in 'int' 'ssize_t' 'SOCKET'; do
1432 for recv_arg2 in 'char *' 'void *'; do
1433 for recv_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do
1434 for recv_arg4 in 'int' 'unsigned int'; do
1435 if test "$curl_cv_func_recv_args" = "unknown"; then
1439 #ifdef HAVE_WINDOWS_H
1440 #ifndef WIN32_LEAN_AND_MEAN
1441 #define WIN32_LEAN_AND_MEAN
1443 #include <windows.h>
1444 #ifdef HAVE_WINSOCK2_H
1445 #include <winsock2.h>
1447 #ifdef HAVE_WINSOCK_H
1448 #include <winsock.h>
1451 #define RECVCALLCONV PASCAL
1453 #ifdef HAVE_SYS_TYPES_H
1454 #include <sys/types.h>
1456 #ifdef HAVE_SYS_SOCKET_H
1457 #include <sys/socket.h>
1459 #define RECVCALLCONV
1461 extern $recv_retv RECVCALLCONV
1462 recv($recv_arg1, $recv_arg2, $recv_arg3, $recv_arg4);
1468 $recv_retv res = recv(s, buf, len, flags);
1471 curl_cv_func_recv_args="$recv_arg1,$recv_arg2,$recv_arg3,$recv_arg4,$recv_retv"
1480 if test "$curl_cv_func_recv_args" = "unknown"; then
1481 AC_MSG_ERROR([Cannot find proper types to use for recv args])
1483 recv_prev_IFS=$IFS; IFS=','
1484 set dummy `echo "$curl_cv_func_recv_args" | sed 's/\*/\*/g'`
1488 AC_DEFINE_UNQUOTED(RECV_TYPE_ARG1, $[1],
1489 [Define to the type of arg 1 for recv.])
1490 AC_DEFINE_UNQUOTED(RECV_TYPE_ARG2, $[2],
1491 [Define to the type of arg 2 for recv.])
1492 AC_DEFINE_UNQUOTED(RECV_TYPE_ARG3, $[3],
1493 [Define to the type of arg 3 for recv.])
1494 AC_DEFINE_UNQUOTED(RECV_TYPE_ARG4, $[4],
1495 [Define to the type of arg 4 for recv.])
1496 AC_DEFINE_UNQUOTED(RECV_TYPE_RETV, $[5],
1497 [Define to the function return type for recv.])
1499 AC_DEFINE_UNQUOTED(HAVE_RECV, 1,
1500 [Define to 1 if you have the recv function.])
1501 ac_cv_func_recv="yes"
1504 AC_MSG_ERROR([Unable to link function recv])
1509 dnl CURL_CHECK_FUNC_SEND
1510 dnl -------------------------------------------------
1511 dnl Test if the socket send() function is available,
1512 dnl and check its return type and the types of its
1513 dnl arguments. If the function succeeds HAVE_SEND
1514 dnl will be defined, defining the types of the arguments
1515 dnl in SEND_TYPE_ARG1, SEND_TYPE_ARG2, SEND_TYPE_ARG3
1516 dnl and SEND_TYPE_ARG4, defining the type of the function
1517 dnl return value in SEND_TYPE_RETV, and also defining the
1518 dnl type qualifier of second argument in SEND_QUAL_ARG2.
1520 AC_DEFUN([CURL_CHECK_FUNC_SEND], [
1521 AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl
1522 AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
1523 AC_CHECK_HEADERS(sys/types.h sys/socket.h)
1525 AC_MSG_CHECKING([for send])
1529 #ifdef HAVE_WINDOWS_H
1530 #ifndef WIN32_LEAN_AND_MEAN
1531 #define WIN32_LEAN_AND_MEAN
1533 #include <windows.h>
1534 #ifdef HAVE_WINSOCK2_H
1535 #include <winsock2.h>
1537 #ifdef HAVE_WINSOCK_H
1538 #include <winsock.h>
1542 #ifdef HAVE_SYS_TYPES_H
1543 #include <sys/types.h>
1545 #ifdef HAVE_SYS_SOCKET_H
1546 #include <sys/socket.h>
1553 AC_MSG_RESULT([yes])
1560 if test "$curl_cv_send" = "yes"; then
1561 AC_CACHE_CHECK([types of args and return type for send],
1562 [curl_cv_func_send_args], [
1563 curl_cv_func_send_args="unknown"
1564 for send_retv in 'int' 'ssize_t'; do
1565 for send_arg1 in 'int' 'ssize_t' 'SOCKET'; do
1566 for send_arg2 in 'char *' 'void *' 'const char *' 'const void *'; do
1567 for send_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do
1568 for send_arg4 in 'int' 'unsigned int'; do
1569 if test "$curl_cv_func_send_args" = "unknown"; then
1573 #ifdef HAVE_WINDOWS_H
1574 #ifndef WIN32_LEAN_AND_MEAN
1575 #define WIN32_LEAN_AND_MEAN
1577 #include <windows.h>
1578 #ifdef HAVE_WINSOCK2_H
1579 #include <winsock2.h>
1581 #ifdef HAVE_WINSOCK_H
1582 #include <winsock.h>
1585 #define SENDCALLCONV PASCAL
1587 #ifdef HAVE_SYS_TYPES_H
1588 #include <sys/types.h>
1590 #ifdef HAVE_SYS_SOCKET_H
1591 #include <sys/socket.h>
1593 #define SENDCALLCONV
1595 extern $send_retv SENDCALLCONV
1596 send($send_arg1, $send_arg2, $send_arg3, $send_arg4);
1601 $send_retv res = send(s, 0, len, flags);
1604 curl_cv_func_send_args="$send_arg1,$send_arg2,$send_arg3,$send_arg4,$send_retv"
1613 if test "$curl_cv_func_send_args" = "unknown"; then
1614 AC_MSG_ERROR([Cannot find proper types to use for send args])
1616 send_prev_IFS=$IFS; IFS=','
1617 set dummy `echo "$curl_cv_func_send_args" | sed 's/\*/\*/g'`
1621 send_qual_type_arg2=$[2]
1623 AC_DEFINE_UNQUOTED(SEND_TYPE_ARG1, $[1],
1624 [Define to the type of arg 1 for send.])
1625 AC_DEFINE_UNQUOTED(SEND_TYPE_ARG3, $[3],
1626 [Define to the type of arg 3 for send.])
1627 AC_DEFINE_UNQUOTED(SEND_TYPE_ARG4, $[4],
1628 [Define to the type of arg 4 for send.])
1629 AC_DEFINE_UNQUOTED(SEND_TYPE_RETV, $[5],
1630 [Define to the function return type for send.])
1634 case $prev_sh_opts in
1642 case "$send_qual_type_arg2" in
1644 send_qual_arg2=const
1645 send_type_arg2=`echo $send_qual_type_arg2 | sed 's/^const //'`
1649 send_type_arg2=$send_qual_type_arg2
1653 AC_DEFINE_UNQUOTED(SEND_QUAL_ARG2, $send_qual_arg2,
1654 [Define to the type qualifier of arg 2 for send.])
1655 AC_DEFINE_UNQUOTED(SEND_TYPE_ARG2, $send_type_arg2,
1656 [Define to the type of arg 2 for send.])
1658 case $prev_sh_opts in
1666 AC_DEFINE_UNQUOTED(HAVE_SEND, 1,
1667 [Define to 1 if you have the send function.])
1668 ac_cv_func_send="yes"
1671 AC_MSG_ERROR([Unable to link function send])
1676 dnl CURL_CHECK_FUNC_RECVFROM
1677 dnl -------------------------------------------------
1678 dnl Test if the socket recvfrom() function is available,
1679 dnl and check its return type and the types of its
1680 dnl arguments. If the function succeeds HAVE_RECVFROM
1681 dnl will be defined, defining the types of the arguments
1682 dnl in RECVFROM_TYPE_ARG1, RECVFROM_TYPE_ARG2, and so on
1683 dnl to RECVFROM_TYPE_ARG6, defining also the type of the
1684 dnl function return value in RECVFROM_TYPE_RETV.
1685 dnl Notice that the types returned for pointer arguments
1686 dnl will actually be the type pointed by the pointer.
1688 AC_DEFUN([CURL_CHECK_FUNC_RECVFROM], [
1689 AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl
1690 AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
1691 AC_CHECK_HEADERS(sys/types.h sys/socket.h)
1693 AC_MSG_CHECKING([for recvfrom])
1697 #ifdef HAVE_WINDOWS_H
1698 #ifndef WIN32_LEAN_AND_MEAN
1699 #define WIN32_LEAN_AND_MEAN
1701 #include <windows.h>
1702 #ifdef HAVE_WINSOCK2_H
1703 #include <winsock2.h>
1705 #ifdef HAVE_WINSOCK_H
1706 #include <winsock.h>
1710 #ifdef HAVE_SYS_TYPES_H
1711 #include <sys/types.h>
1713 #ifdef HAVE_SYS_SOCKET_H
1714 #include <sys/socket.h>
1718 recvfrom(0, 0, 0, 0, 0, 0);
1721 AC_MSG_RESULT([yes])
1722 curl_cv_recvfrom="yes"
1725 curl_cv_recvfrom="no"
1728 if test "$curl_cv_recvfrom" = "yes"; then
1729 AC_CACHE_CHECK([types of args and return type for recvfrom],
1730 [curl_cv_func_recvfrom_args], [
1731 curl_cv_func_recvfrom_args="unknown"
1732 for recvfrom_retv in 'int' 'ssize_t'; do
1733 for recvfrom_arg1 in 'int' 'ssize_t' 'SOCKET'; do
1734 for recvfrom_arg2 in 'char *' 'void *'; do
1735 for recvfrom_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do
1736 for recvfrom_arg4 in 'int' 'unsigned int'; do
1737 for recvfrom_arg5 in 'struct sockaddr *' 'void *'; do
1738 for recvfrom_arg6 in 'socklen_t *' 'int *' 'unsigned int *' 'size_t *' 'void *'; do
1739 if test "$curl_cv_func_recvfrom_args" = "unknown"; then
1743 #ifdef HAVE_WINDOWS_H
1744 #ifndef WIN32_LEAN_AND_MEAN
1745 #define WIN32_LEAN_AND_MEAN
1747 #include <windows.h>
1748 #ifdef HAVE_WINSOCK2_H
1749 #include <winsock2.h>
1751 #ifdef HAVE_WINSOCK_H
1752 #include <winsock.h>
1755 #define RECVFROMCALLCONV PASCAL
1757 #ifdef HAVE_SYS_TYPES_H
1758 #include <sys/types.h>
1760 #ifdef HAVE_SYS_SOCKET_H
1761 #include <sys/socket.h>
1763 #define RECVFROMCALLCONV
1765 extern $recvfrom_retv RECVFROMCALLCONV
1766 recvfrom($recvfrom_arg1, $recvfrom_arg2,
1767 $recvfrom_arg3, $recvfrom_arg4,
1768 $recvfrom_arg5, $recvfrom_arg6);
1771 $recvfrom_arg2 buf=0;
1772 $recvfrom_arg3 len=0;
1773 $recvfrom_arg4 flags=0;
1774 $recvfrom_arg5 addr=0;
1775 $recvfrom_arg6 addrlen=0;
1776 $recvfrom_retv res=0;
1777 res = recvfrom(s, buf, len, flags, addr, addrlen);
1780 curl_cv_func_recvfrom_args="$recvfrom_arg1,$recvfrom_arg2,$recvfrom_arg3,$recvfrom_arg4,$recvfrom_arg5,$recvfrom_arg6,$recvfrom_retv"
1791 # Nearly last minute change for this release starts here
1792 AC_DEFINE_UNQUOTED(HAVE_RECVFROM, 1,
1793 [Define to 1 if you have the recvfrom function.])
1794 ac_cv_func_recvfrom="yes"
1795 # Nearly last minute change for this release ends here
1796 if test "$curl_cv_func_recvfrom_args" = "unknown"; then
1797 AC_MSG_WARN([Cannot find proper types to use for recvfrom args])
1799 recvfrom_prev_IFS=$IFS; IFS=','
1800 set dummy `echo "$curl_cv_func_recvfrom_args" | sed 's/\*/\*/g'`
1801 IFS=$recvfrom_prev_IFS
1804 recvfrom_ptrt_arg2=$[2]
1805 recvfrom_ptrt_arg5=$[5]
1806 recvfrom_ptrt_arg6=$[6]
1808 AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG1, $[1],
1809 [Define to the type of arg 1 for recvfrom.])
1810 AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG3, $[3],
1811 [Define to the type of arg 3 for recvfrom.])
1812 AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG4, $[4],
1813 [Define to the type of arg 4 for recvfrom.])
1814 AC_DEFINE_UNQUOTED(RECVFROM_TYPE_RETV, $[7],
1815 [Define to the function return type for recvfrom.])
1819 case $prev_sh_opts in
1827 recvfrom_type_arg2=`echo $recvfrom_ptrt_arg2 | sed 's/ \*//'`
1828 recvfrom_type_arg5=`echo $recvfrom_ptrt_arg5 | sed 's/ \*//'`
1829 recvfrom_type_arg6=`echo $recvfrom_ptrt_arg6 | sed 's/ \*//'`
1831 AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG2, $recvfrom_type_arg2,
1832 [Define to the type pointed by arg 2 for recvfrom.])
1833 AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG5, $recvfrom_type_arg5,
1834 [Define to the type pointed by arg 5 for recvfrom.])
1835 AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG6, $recvfrom_type_arg6,
1836 [Define to the type pointed by arg 6 for recvfrom.])
1838 if test "$recvfrom_type_arg2" = "void"; then
1839 AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG2_IS_VOID, 1,
1840 [Define to 1 if the type pointed by arg 2 for recvfrom is void.])
1842 if test "$recvfrom_type_arg5" = "void"; then
1843 AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG5_IS_VOID, 1,
1844 [Define to 1 if the type pointed by arg 5 for recvfrom is void.])
1846 if test "$recvfrom_type_arg6" = "void"; then
1847 AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG6_IS_VOID, 1,
1848 [Define to 1 if the type pointed by arg 6 for recvfrom is void.])
1851 case $prev_sh_opts in
1859 AC_DEFINE_UNQUOTED(HAVE_RECVFROM, 1,
1860 [Define to 1 if you have the recvfrom function.])
1861 ac_cv_func_recvfrom="yes"
1864 AC_MSG_WARN([Unable to link function recvfrom])
1869 dnl CURL_CHECK_MSG_NOSIGNAL
1870 dnl -------------------------------------------------
1871 dnl Check for MSG_NOSIGNAL
1873 AC_DEFUN([CURL_CHECK_MSG_NOSIGNAL], [
1874 AC_CHECK_HEADERS(sys/types.h sys/socket.h)
1875 AC_CACHE_CHECK([for MSG_NOSIGNAL], [ac_cv_msg_nosignal], [
1879 #ifdef HAVE_WINDOWS_H
1880 #ifndef WIN32_LEAN_AND_MEAN
1881 #define WIN32_LEAN_AND_MEAN
1883 #include <windows.h>
1884 #ifdef HAVE_WINSOCK2_H
1885 #include <winsock2.h>
1887 #ifdef HAVE_WINSOCK_H
1888 #include <winsock.h>
1892 #ifdef HAVE_SYS_TYPES_H
1893 #include <sys/types.h>
1895 #ifdef HAVE_SYS_SOCKET_H
1896 #include <sys/socket.h>
1900 int flag=MSG_NOSIGNAL;
1903 ac_cv_msg_nosignal="yes"
1905 ac_cv_msg_nosignal="no"
1908 case "$ac_cv_msg_nosignal" in
1910 AC_DEFINE_UNQUOTED(HAVE_MSG_NOSIGNAL, 1,
1911 [Define to 1 if you have the MSG_NOSIGNAL flag.])
1917 dnl CURL_CHECK_STRUCT_TIMEVAL
1918 dnl -------------------------------------------------
1919 dnl Check for timeval struct
1921 AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [
1922 AC_REQUIRE([AC_HEADER_TIME])dnl
1923 AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl
1924 AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
1925 AC_CHECK_HEADERS(sys/types.h sys/time.h time.h)
1926 AC_CACHE_CHECK([for struct timeval], [ac_cv_struct_timeval], [
1930 #ifdef HAVE_WINDOWS_H
1931 #ifndef WIN32_LEAN_AND_MEAN
1932 #define WIN32_LEAN_AND_MEAN
1934 #include <windows.h>
1935 #ifdef HAVE_WINSOCK2_H
1936 #include <winsock2.h>
1938 #ifdef HAVE_WINSOCK_H
1939 #include <winsock.h>
1943 #ifdef HAVE_SYS_TYPES_H
1944 #include <sys/types.h>
1946 #ifdef HAVE_SYS_TIME_H
1947 #include <sys/time.h>
1948 #ifdef TIME_WITH_SYS_TIME
1962 ac_cv_struct_timeval="yes"
1964 ac_cv_struct_timeval="no"
1967 case "$ac_cv_struct_timeval" in
1969 AC_DEFINE_UNQUOTED(HAVE_STRUCT_TIMEVAL, 1,
1970 [Define to 1 if you have the timeval struct.])
1976 dnl TYPE_SIG_ATOMIC_T
1977 dnl -------------------------------------------------
1978 dnl Check if the sig_atomic_t type is available, and
1979 dnl verify if it is already defined as volatile.
1981 AC_DEFUN([TYPE_SIG_ATOMIC_T], [
1982 AC_CHECK_HEADERS(signal.h)
1983 AC_CHECK_TYPE([sig_atomic_t],[
1984 AC_DEFINE(HAVE_SIG_ATOMIC_T, 1,
1985 [Define to 1 if sig_atomic_t is an available typedef.])
1987 #ifdef HAVE_SIGNAL_H
1991 case "$ac_cv_type_sig_atomic_t" in
1994 AC_MSG_CHECKING([if sig_atomic_t is already defined as volatile])
1997 #ifdef HAVE_SIGNAL_H
2001 static volatile sig_atomic_t dummy = 0;
2005 ac_cv_sig_atomic_t_volatile="no"
2007 AC_MSG_RESULT([yes])
2008 ac_cv_sig_atomic_t_volatile="yes"
2011 if test "$ac_cv_sig_atomic_t_volatile" = "yes"; then
2012 AC_DEFINE(HAVE_SIG_ATOMIC_T_VOLATILE, 1,
2013 [Define to 1 if sig_atomic_t is already defined as volatile.])
2021 dnl -------------------------------------------------
2022 dnl Check for in_addr_t: it is used to receive the return code of inet_addr()
2023 dnl and a few other things.
2025 AC_DEFUN([TYPE_IN_ADDR_T], [
2026 AC_CHECK_TYPE([in_addr_t], ,[
2027 dnl in_addr_t not available
2028 AC_CACHE_CHECK([for in_addr_t equivalent],
2029 [curl_cv_in_addr_t_equiv], [
2030 curl_cv_in_addr_t_equiv="unknown"
2031 for t in "unsigned long" int size_t unsigned long; do
2032 if test "$curl_cv_in_addr_t_equiv" = "unknown"; then
2036 #ifdef HAVE_WINDOWS_H
2037 #ifndef WIN32_LEAN_AND_MEAN
2038 #define WIN32_LEAN_AND_MEAN
2040 #include <windows.h>
2041 #ifdef HAVE_WINSOCK2_H
2042 #include <winsock2.h>
2044 #ifdef HAVE_WINSOCK_H
2045 #include <winsock.h>
2049 #ifdef HAVE_SYS_TYPES_H
2050 #include <sys/types.h>
2052 #ifdef HAVE_SYS_SOCKET_H
2053 #include <sys/socket.h>
2055 #ifdef HAVE_NETINET_IN_H
2056 #include <netinet/in.h>
2058 #ifdef HAVE_ARPA_INET_H
2059 #include <arpa/inet.h>
2063 $t data = inet_addr ("1.2.3.4");
2066 curl_cv_in_addr_t_equiv="$t"
2071 case "$curl_cv_in_addr_t_equiv" in
2073 AC_MSG_ERROR([Cannot find a type to use in place of in_addr_t])
2076 AC_DEFINE_UNQUOTED(in_addr_t, $curl_cv_in_addr_t_equiv,
2077 [Type to use in place of in_addr_t when system does not provide it.])
2082 #ifdef HAVE_WINDOWS_H
2083 #ifndef WIN32_LEAN_AND_MEAN
2084 #define WIN32_LEAN_AND_MEAN
2086 #include <windows.h>
2087 #ifdef HAVE_WINSOCK2_H
2088 #include <winsock2.h>
2090 #ifdef HAVE_WINSOCK_H
2091 #include <winsock.h>
2095 #ifdef HAVE_SYS_TYPES_H
2096 #include <sys/types.h>
2098 #ifdef HAVE_SYS_SOCKET_H
2099 #include <sys/socket.h>
2101 #ifdef HAVE_NETINET_IN_H
2102 #include <netinet/in.h>
2104 #ifdef HAVE_ARPA_INET_H
2105 #include <arpa/inet.h>
2112 dnl CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC
2113 dnl -------------------------------------------------
2114 dnl Check if monotonic clock_gettime is available.
2116 AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC], [
2117 AC_REQUIRE([AC_HEADER_TIME])dnl
2118 AC_CHECK_HEADERS(sys/types.h sys/time.h time.h)
2119 AC_MSG_CHECKING([for monotonic clock_gettime])
2122 #ifdef HAVE_SYS_TYPES_H
2123 #include <sys/types.h>
2125 #ifdef HAVE_SYS_TIME_H
2126 #include <sys/time.h>
2127 #ifdef TIME_WITH_SYS_TIME
2137 (void)clock_gettime(CLOCK_MONOTONIC, &ts);
2140 AC_MSG_RESULT([yes])
2141 ac_cv_func_clock_gettime="yes"
2144 ac_cv_func_clock_gettime="no"
2146 dnl Definition of HAVE_CLOCK_GETTIME_MONOTONIC is intentionally postponed
2147 dnl until library linking and run-time checks for clock_gettime succeed.
2151 dnl CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
2152 dnl -------------------------------------------------
2153 dnl If monotonic clock_gettime is available then,
2154 dnl check and prepended to LIBS any needed libraries.
2156 AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
2157 AC_REQUIRE([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC])dnl
2159 if test "$ac_cv_func_clock_gettime" = "yes"; then
2161 AC_MSG_CHECKING([for clock_gettime in libraries])
2163 curl_cv_save_LIBS="$LIBS"
2164 curl_cv_gclk_LIBS="unknown"
2166 for x_xlibs in '' '-lrt' '-lposix4' ; do
2167 if test "$curl_cv_gclk_LIBS" = "unknown"; then
2168 if test -z "$x_xlibs"; then
2169 LIBS="$curl_cv_save_LIBS"
2171 LIBS="$x_xlibs $curl_cv_save_LIBS"
2175 #ifdef HAVE_SYS_TYPES_H
2176 #include <sys/types.h>
2178 #ifdef HAVE_SYS_TIME_H
2179 #include <sys/time.h>
2180 #ifdef TIME_WITH_SYS_TIME
2190 (void)clock_gettime(CLOCK_MONOTONIC, &ts);
2193 curl_cv_gclk_LIBS="$x_xlibs"
2198 LIBS="$curl_cv_save_LIBS"
2200 case X-"$curl_cv_gclk_LIBS" in
2202 AC_MSG_RESULT([cannot find clock_gettime])
2203 AC_MSG_WARN([HAVE_CLOCK_GETTIME_MONOTONIC will not be defined])
2204 ac_cv_func_clock_gettime="no"
2207 AC_MSG_RESULT([no additional lib required])
2208 ac_cv_func_clock_gettime="yes"
2211 if test -z "$curl_cv_save_LIBS"; then
2212 LIBS="$curl_cv_gclk_LIBS"
2214 LIBS="$curl_cv_gclk_LIBS $curl_cv_save_LIBS"
2216 AC_MSG_RESULT([$curl_cv_gclk_LIBS])
2217 ac_cv_func_clock_gettime="yes"
2221 dnl only do runtime verification when not cross-compiling
2222 if test "x$cross_compiling" != "xyes" &&
2223 test "$ac_cv_func_clock_gettime" = "yes"; then
2224 AC_MSG_CHECKING([if monotonic clock_gettime works])
2227 #ifdef HAVE_STDLIB_H
2230 #ifdef HAVE_SYS_TYPES_H
2231 #include <sys/types.h>
2233 #ifdef HAVE_SYS_TIME_H
2234 #include <sys/time.h>
2235 #ifdef TIME_WITH_SYS_TIME
2245 if (0 == clock_gettime(CLOCK_MONOTONIC, &ts))
2251 AC_MSG_RESULT([yes])
2254 AC_MSG_WARN([HAVE_CLOCK_GETTIME_MONOTONIC will not be defined])
2255 ac_cv_func_clock_gettime="no"
2256 LIBS="$curl_cv_save_LIBS"
2260 case "$ac_cv_func_clock_gettime" in
2262 AC_DEFINE_UNQUOTED(HAVE_CLOCK_GETTIME_MONOTONIC, 1,
2263 [Define to 1 if you have the clock_gettime function and monotonic timer.])
2272 dnl CURL_CHECK_FUNC_SELECT
2273 dnl -------------------------------------------------
2274 dnl Test if the socket select() function is available,
2275 dnl and check its return type and the types of its
2276 dnl arguments. If the function succeeds HAVE_SELECT
2277 dnl will be defined, defining the types of the
2278 dnl arguments in SELECT_TYPE_ARG1, SELECT_TYPE_ARG234
2279 dnl and SELECT_TYPE_ARG5, defining the type of the
2280 dnl function return value in SELECT_TYPE_RETV, and
2281 dnl also defining the type qualifier of fifth argument
2282 dnl in SELECT_QUAL_ARG5.
2284 AC_DEFUN([CURL_CHECK_FUNC_SELECT], [
2285 AC_REQUIRE([CURL_CHECK_STRUCT_TIMEVAL])dnl
2286 AC_CHECK_HEADERS(sys/select.h sys/socket.h)
2288 AC_MSG_CHECKING([for select])
2292 #ifdef HAVE_WINDOWS_H
2293 #ifndef WIN32_LEAN_AND_MEAN
2294 #define WIN32_LEAN_AND_MEAN
2296 #include <windows.h>
2297 #ifdef HAVE_WINSOCK2_H
2298 #include <winsock2.h>
2300 #ifdef HAVE_WINSOCK_H
2301 #include <winsock.h>
2305 #ifdef HAVE_SYS_TYPES_H
2306 #include <sys/types.h>
2308 #ifdef HAVE_SYS_TIME_H
2309 #include <sys/time.h>
2310 #ifdef TIME_WITH_SYS_TIME
2318 #ifndef HAVE_WINDOWS_H
2319 #ifdef HAVE_SYS_SELECT_H
2320 #include <sys/select.h>
2322 #ifdef HAVE_SYS_SOCKET_H
2323 #include <sys/socket.h>
2327 select(0, 0, 0, 0, 0);
2330 AC_MSG_RESULT([yes])
2331 curl_cv_select="yes"
2337 if test "$curl_cv_select" = "yes"; then
2338 AC_CACHE_CHECK([types of args and return type for select],
2339 [curl_cv_func_select_args], [
2340 curl_cv_func_select_args="unknown"
2341 for sel_retv in 'int' 'ssize_t'; do
2342 for sel_arg1 in 'int' 'ssize_t' 'size_t' 'unsigned long int' 'unsigned int'; do
2343 for sel_arg234 in 'fd_set *' 'int *' 'void *'; do
2344 for sel_arg5 in 'struct timeval *' 'const struct timeval *'; do
2345 if test "$curl_cv_func_select_args" = "unknown"; then
2349 #ifdef HAVE_WINDOWS_H
2350 #ifndef WIN32_LEAN_AND_MEAN
2351 #define WIN32_LEAN_AND_MEAN
2353 #include <windows.h>
2354 #ifdef HAVE_WINSOCK2_H
2355 #include <winsock2.h>
2357 #ifdef HAVE_WINSOCK_H
2358 #include <winsock.h>
2361 #define SELECTCALLCONV PASCAL
2363 #ifdef HAVE_SYS_TYPES_H
2364 #include <sys/types.h>
2366 #ifdef HAVE_SYS_TIME_H
2367 #include <sys/time.h>
2368 #ifdef TIME_WITH_SYS_TIME
2376 #ifndef HAVE_WINDOWS_H
2377 #ifdef HAVE_SYS_SELECT_H
2378 #include <sys/select.h>
2380 #ifdef HAVE_SYS_SOCKET_H
2381 #include <sys/socket.h>
2383 #define SELECTCALLCONV
2385 #ifndef HAVE_STRUCT_TIMEVAL
2391 extern $sel_retv SELECTCALLCONV select($sel_arg1,
2401 $sel_retv res = select(nfds, rfds, wfds, efds, 0);
2404 curl_cv_func_select_args="$sel_arg1,$sel_arg234,$sel_arg5,$sel_retv"
2412 if test "$curl_cv_func_select_args" = "unknown"; then
2413 AC_MSG_WARN([Cannot find proper types to use for select args])
2414 AC_MSG_WARN([HAVE_SELECT will not be defined])
2416 select_prev_IFS=$IFS; IFS=','
2417 set dummy `echo "$curl_cv_func_select_args" | sed 's/\*/\*/g'`
2418 IFS=$select_prev_IFS
2421 sel_qual_type_arg5=$[3]
2423 AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG1, $[1],
2424 [Define to the type of arg 1 for select.])
2425 AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG234, $[2],
2426 [Define to the type of args 2, 3 and 4 for select.])
2427 AC_DEFINE_UNQUOTED(SELECT_TYPE_RETV, $[4],
2428 [Define to the function return type for select.])
2432 case $prev_sh_opts in
2440 case "$sel_qual_type_arg5" in
2443 sel_type_arg5=`echo $sel_qual_type_arg5 | sed 's/^const //'`
2447 sel_type_arg5=$sel_qual_type_arg5
2451 AC_DEFINE_UNQUOTED(SELECT_QUAL_ARG5, $sel_qual_arg5,
2452 [Define to the type qualifier of arg 5 for select.])
2453 AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5, $sel_type_arg5,
2454 [Define to the type of arg 5 for select.])
2456 case $prev_sh_opts in
2464 AC_DEFINE_UNQUOTED(HAVE_SELECT, 1,
2465 [Define to 1 if you have the select function.])
2466 ac_cv_func_select="yes"
2472 # This is only a temporary fix. This macro is here to replace the broken one
2473 # delivered by the automake project (including the 1.9.6 release). As soon as
2474 # they ship a working version we SHOULD remove this work-around.
2476 AC_DEFUN([AM_MISSING_HAS_RUN],
2477 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2478 test x"${MISSING+set}" = xset || MISSING="\${SHELL} \"$am_aux_dir/missing\""
2479 # Use eval to expand $SHELL
2480 if eval "$MISSING --run true"; then
2481 am_missing_run="$MISSING --run "
2484 AC_MSG_WARN([`missing' script is too old or missing])
2489 dnl CURL_VERIFY_RUNTIMELIBS
2490 dnl -------------------------------------------------
2491 dnl Verify that the shared libs found so far can be used when running
2492 dnl programs, since otherwise the situation will create odd configure errors
2493 dnl that are misleading people.
2495 dnl Make sure this test is run BEFORE the first test in the script that
2496 dnl runs anything, which at the time of this writing is the AC_CHECK_SIZEOF
2497 dnl macro. It must also run AFTER all lib-checking macros are complete.
2499 AC_DEFUN([CURL_VERIFY_RUNTIMELIBS], [
2501 dnl this test is of course not sensible if we are cross-compiling!
2502 if test "x$cross_compiling" != xyes; then
2504 dnl just run a program to verify that the libs checked for previous to this
2505 dnl point also is available run-time!
2506 AC_MSG_CHECKING([run-time libs availability])
2513 AC_MSG_RESULT([fine]),
2514 AC_MSG_RESULT([failed])
2515 AC_MSG_ERROR([one or more libs available at link-time are not available run-time. Libs used at link-time: $LIBS])
2518 dnl if this test fails, configure has already stopped
2523 dnl CURL_CHECK_VARIADIC_MACROS
2524 dnl -------------------------------------------------
2525 dnl Check compiler support of variadic macros
2527 AC_DEFUN([CURL_CHECK_VARIADIC_MACROS], [
2528 AC_CACHE_CHECK([for compiler support of C99 variadic macro style],
2529 [curl_cv_variadic_macros_c99], [
2532 #define c99_vmacro3(first, ...) fun3(first, __VA_ARGS__)
2533 #define c99_vmacro2(first, ...) fun2(first, __VA_ARGS__)
2534 int fun3(int arg1, int arg2, int arg3);
2535 int fun2(int arg1, int arg2);
2536 int fun3(int arg1, int arg2, int arg3)
2537 { return arg1 + arg2 + arg3; }
2538 int fun2(int arg1, int arg2)
2539 { return arg1 + arg2; }
2541 int res3 = c99_vmacro3(1, 2, 3);
2542 int res2 = c99_vmacro2(1, 2);
2545 curl_cv_variadic_macros_c99="yes"
2547 curl_cv_variadic_macros_c99="no"
2550 case "$curl_cv_variadic_macros_c99" in
2552 AC_DEFINE_UNQUOTED(HAVE_VARIADIC_MACROS_C99, 1,
2553 [Define to 1 if compiler supports C99 variadic macro style.])
2556 AC_CACHE_CHECK([for compiler support of old gcc variadic macro style],
2557 [curl_cv_variadic_macros_gcc], [
2560 #define gcc_vmacro3(first, args...) fun3(first, args)
2561 #define gcc_vmacro2(first, args...) fun2(first, args)
2562 int fun3(int arg1, int arg2, int arg3);
2563 int fun2(int arg1, int arg2);
2564 int fun3(int arg1, int arg2, int arg3)
2565 { return arg1 + arg2 + arg3; }
2566 int fun2(int arg1, int arg2)
2567 { return arg1 + arg2; }
2569 int res3 = gcc_vmacro3(1, 2, 3);
2570 int res2 = gcc_vmacro2(1, 2);
2573 curl_cv_variadic_macros_gcc="yes"
2575 curl_cv_variadic_macros_gcc="no"
2578 case "$curl_cv_variadic_macros_gcc" in
2580 AC_DEFINE_UNQUOTED(HAVE_VARIADIC_MACROS_GCC, 1,
2581 [Define to 1 if compiler supports old gcc variadic macro style.])
2587 dnl CURL_CHECK_CA_BUNDLE
2588 dnl -------------------------------------------------
2589 dnl Check if a default ca-bundle should be used
2591 dnl regarding the paths this will scan:
2592 dnl /etc/ssl/certs/ca-certificates.crt Debian systems
2593 dnl /etc/pki/tls/certs/ca-bundle.crt Redhat and Mandriva
2594 dnl /usr/share/ssl/certs/ca-bundle.crt old(er) Redhat
2595 dnl /usr/local/share/certs/ca-root.crt FreeBSD
2596 dnl /etc/ssl/cert.pem OpenBSD
2597 dnl /etc/ssl/certs/ (ca path) SUSE
2599 AC_DEFUN([CURL_CHECK_CA_BUNDLE], [
2601 AC_MSG_CHECKING([default CA cert bundle/path])
2603 AC_ARG_WITH(ca-bundle,
2604 AC_HELP_STRING([--with-ca-bundle=FILE], [File name to use as CA bundle])
2605 AC_HELP_STRING([--without-ca-bundle], [Don't use a default CA bundle]),
2608 if test "x$want_ca" = "xyes"; then
2609 AC_MSG_ERROR([--with-ca-bundle=FILE requires a path to the CA bundle])
2612 [ want_ca="unset" ])
2613 AC_ARG_WITH(ca-path,
2614 AC_HELP_STRING([--with-ca-path=DIRECTORY], [Directory to use as CA path])
2615 AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
2617 want_capath="$withval"
2618 if test "x$want_capath" = "xyes"; then
2619 AC_MSG_ERROR([--with-ca-path=DIRECTORY requires a path to the CA path directory])
2622 [ want_capath="unset"])
2624 if test "x$want_ca" != "xno" -a "x$want_ca" != "xunset" -a \
2625 "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then
2627 AC_MSG_ERROR([Can't specify both --with-ca-bundle and --with-ca-path.])
2628 elif test "x$want_ca" != "xno" -a "x$want_ca" != "xunset"; then
2629 dnl --with-ca-bundle given
2632 elif test "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then
2633 dnl --with-ca-path given
2634 if test "x$OPENSSL_ENABLED" != "x1"; then
2635 AC_MSG_ERROR([--with-ca-path only works with openSSL])
2637 capath="$want_capath"
2640 dnl neither of --with-ca-* given
2641 dnl first try autodetecting a CA bundle , then a CA path
2642 dnl both autodetections can be skipped by --without-ca-*
2645 if test "x$want_ca" = "xunset"; then
2646 dnl the path we previously would have installed the curl ca bundle
2647 dnl to, and thus we now check for an already existing cert in that place
2648 dnl in case we find no other
2649 if test "x$prefix" != xNONE; then
2650 cac="${prefix}/share/curl/curl-ca-bundle.crt"
2652 cac="$ac_default_prefix/share/curl/curl-ca-bundle.crt"
2655 for a in /etc/ssl/certs/ca-certificates.crt \
2656 /etc/pki/tls/certs/ca-bundle.crt \
2657 /usr/share/ssl/certs/ca-bundle.crt \
2658 /usr/local/share/certs/ca-root.crt \
2661 if test -f "$a"; then
2667 if test "x$want_capath" = "xunset" -a "x$ca" = "xno" -a \
2668 "x$OPENSSL_ENABLED" = "x1"; then
2669 for a in /etc/ssl/certs/; do
2670 if test -d "$a" && ls "$a"/[[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]].0 >/dev/null 2>/dev/null; then
2680 if test "x$ca" != "xno"; then
2681 CURL_CA_BUNDLE='"'$ca'"'
2682 AC_DEFINE_UNQUOTED(CURL_CA_BUNDLE, "$ca", [Location of default ca bundle])
2683 AC_SUBST(CURL_CA_BUNDLE)
2684 AC_MSG_RESULT([$ca])
2685 elif test "x$capath" != "xno"; then
2686 CURL_CA_PATH="\"$capath\""
2687 AC_DEFINE_UNQUOTED(CURL_CA_PATH, "$capath", [Location of default ca path])
2688 AC_MSG_RESULT([$capath (capath)])
2695 dnl CURL_DEFINE_UNQUOTED (VARIABLE, [VALUE])
2696 dnl -------------------------------------------------
2697 dnl Like AC_DEFINE_UNQUOTED this macro will define a C preprocessor
2698 dnl symbol that can be further used in custom template configuration
2699 dnl files. This macro, unlike AC_DEFINE_UNQUOTED, does not use a third
2700 dnl argument for the description. Symbol definitions done with this
2701 dnl macro are intended to be exclusively used in handcrafted *.h.in
2702 dnl template files. Contrary to what AC_DEFINE_UNQUOTED does, this one
2703 dnl prevents autoheader generation and insertion of symbol template
2704 dnl stub and definition into the first configuration header file. Do
2705 dnl not use this macro as a replacement for AC_DEFINE_UNQUOTED, each
2706 dnl one serves different functional needs.
2708 AC_DEFUN([CURL_DEFINE_UNQUOTED], [
2709 cat >>confdefs.h <<_EOF
2710 [@%:@define] $1 ifelse($#, 2, [$2], 1)
2715 dnl CURL_INCLUDES_INTTYPES
2716 dnl -------------------------------------------------
2717 dnl Set up variable with list of headers that must be
2718 dnl included when inttypes.h is to be included.
2720 AC_DEFUN([CURL_INCLUDES_INTTYPES], [
2721 curl_includes_inttypes="\
2722 /* includes start */
2723 #ifdef HAVE_SYS_TYPES_H
2724 # include <sys/types.h>
2726 #ifdef HAVE_STDINT_H
2727 # include <stdint.h>
2729 #ifdef HAVE_INTTYPES_H
2730 # include <inttypes.h>
2734 sys/types.h stdint.h inttypes.h,
2735 [], [], [$curl_includes_inttypes])
2739 dnl CURL_CONFIGURE_LONG
2740 dnl -------------------------------------------------
2741 dnl Find out the size of long as reported by sizeof() and define
2742 dnl CURL_SIZEOF_LONG as appropriate to be used in template file
2743 dnl include/curl/curlbuild.h.in to properly configure the library.
2744 dnl The size of long is a build time characteristic and as such
2745 dnl must be recorded in curlbuild.h
2747 AC_DEFUN([CURL_CONFIGURE_LONG], [
2748 if test -z "$ac_cv_sizeof_long" ||
2749 test "$ac_cv_sizeof_long" -eq "0"; then
2750 AC_MSG_ERROR([cannot find out size of long.])
2752 CURL_DEFINE_UNQUOTED([CURL_SIZEOF_LONG], [$ac_cv_sizeof_long])
2756 dnl DO_CURL_OFF_T_CHECK (TYPE, SIZE)
2757 dnl -------------------------------------------------
2758 dnl Internal macro for CURL_CONFIGURE_CURL_OFF_T
2760 AC_DEFUN([DO_CURL_OFF_T_CHECK], [
2761 AC_REQUIRE([CURL_INCLUDES_INTTYPES])dnl
2762 if test "$curl_typeof_curl_off_t" = "unknown" && test ! -z "$1"; then
2766 case AS_TR_SH([$1]) in
2768 tmp_includes="$curl_includes_inttypes"
2769 tmp_source="char f@<:@@:>@ = PRId64;"
2773 tmp_includes="$curl_includes_inttypes"
2774 tmp_source="char f@<:@@:>@ = PRId32;"
2778 tmp_includes="$curl_includes_inttypes"
2779 tmp_source="char f@<:@@:>@ = PRId16;"
2786 typedef $1 curl_off_t;
2787 typedef char dummy_arr[sizeof(curl_off_t) == $2 ? 1 : -1];
2793 if test -z "$tmp_fmt"; then
2794 curl_typeof_curl_off_t="$1"
2795 curl_sizeof_curl_off_t="$2"
2797 CURL_CHECK_DEF([$tmp_fmt], [$curl_includes_inttypes], [silent])
2798 AS_VAR_PUSHDEF([tmp_HaveFmtDef], [curl_cv_have_def_$tmp_fmt])dnl
2799 AS_VAR_PUSHDEF([tmp_FmtDef], [curl_cv_def_$tmp_fmt])dnl
2800 if test AS_VAR_GET(tmp_HaveFmtDef) = "yes"; then
2801 curl_format_curl_off_t=AS_VAR_GET(tmp_FmtDef)
2802 curl_typeof_curl_off_t="$1"
2803 curl_sizeof_curl_off_t="$2"
2805 AS_VAR_POPDEF([tmp_FmtDef])dnl
2806 AS_VAR_POPDEF([tmp_HaveFmtDef])dnl
2813 dnl DO_CURL_OFF_T_SUFFIX_CHECK (TYPE)
2814 dnl -------------------------------------------------
2815 dnl Internal macro for CURL_CONFIGURE_CURL_OFF_T
2817 AC_DEFUN([DO_CURL_OFF_T_SUFFIX_CHECK], [
2818 AC_REQUIRE([CURL_INCLUDES_INTTYPES])dnl
2819 AC_MSG_CHECKING([constant suffix string for curl_off_t])
2821 curl_suffix_curl_off_t="unknown"
2822 curl_suffix_curl_off_tu="unknown"
2824 case AS_TR_SH([$1]) in
2825 long_long | __longlong | __longlong_t)
2835 tst_suffixes="LL:i64::"
2838 tst_suffixes="L:i32::"
2841 tst_suffixes="L:i16::"
2844 AC_MSG_ERROR([unexpected data type $1])
2848 old_IFS=$IFS; IFS=':'
2849 for tmp_ssuf in $tst_suffixes ; do
2851 if test "x$curl_suffix_curl_off_t" = "xunknown"; then
2854 tmp_usuf="u$tmp_ssuf"
2857 tmp_usuf="U$tmp_ssuf"
2865 $curl_includes_inttypes
2876 curl_suffix_curl_off_t="$tmp_ssuf"
2877 curl_suffix_curl_off_tu="$tmp_usuf"
2883 if test "x$curl_suffix_curl_off_t" = "xunknown"; then
2884 AC_MSG_ERROR([cannot find constant suffix string for curl_off_t.])
2886 AC_MSG_RESULT([$curl_suffix_curl_off_t])
2887 AC_MSG_CHECKING([constant suffix string for unsigned curl_off_t])
2888 AC_MSG_RESULT([$curl_suffix_curl_off_tu])
2894 dnl CURL_CONFIGURE_CURL_OFF_T
2895 dnl -------------------------------------------------
2896 dnl Find out suitable curl_off_t data type definition and associated
2897 dnl items, and make the appropriate definitions used in template file
2898 dnl include/curl/curlbuild.h.in to properly configure the library.
2900 AC_DEFUN([CURL_CONFIGURE_CURL_OFF_T], [
2901 AC_REQUIRE([CURL_INCLUDES_INTTYPES])dnl
2903 AC_BEFORE([$0],[AC_SYS_LARGEFILE])dnl
2904 AC_BEFORE([$0],[CURL_CONFIGURE_REENTRANT])dnl
2905 AC_BEFORE([$0],[CURL_CHECK_AIX_ALL_SOURCE])dnl
2907 if test -z "$SED"; then
2908 AC_MSG_ERROR([SED not set. Cannot continue without SED being set.])
2911 AC_CHECK_SIZEOF(long)
2912 AC_CHECK_SIZEOF(void*)
2914 if test -z "$ac_cv_sizeof_long" ||
2915 test "$ac_cv_sizeof_long" -eq "0"; then
2916 AC_MSG_ERROR([cannot find out size of long.])
2918 if test -z "$ac_cv_sizeof_voidp" ||
2919 test "$ac_cv_sizeof_voidp" -eq "0"; then
2920 AC_MSG_ERROR([cannot find out size of void*.])
2927 if test "$ac_cv_sizeof_long" -eq "8" &&
2928 test "$ac_cv_sizeof_voidp" -ge "8"; then
2930 elif test "$ac_cv_sizeof_long" -eq "4" &&
2931 test "$ac_cv_sizeof_voidp" -ge "4"; then
2933 elif test "$ac_cv_sizeof_long" -eq "2" &&
2934 test "$ac_cv_sizeof_voidp" -ge "2"; then
2938 dnl DO_CURL_OFF_T_CHECK results are stored in next 3 vars
2940 curl_typeof_curl_off_t="unknown"
2941 curl_sizeof_curl_off_t="unknown"
2942 curl_format_curl_off_t="unknown"
2943 curl_format_curl_off_tu="unknown"
2945 if test "$curl_typeof_curl_off_t" = "unknown"; then
2946 AC_MSG_CHECKING([for 64-bit curl_off_t data type])
2954 DO_CURL_OFF_T_CHECK([$t8], [8])
2956 AC_MSG_RESULT([$curl_typeof_curl_off_t])
2958 if test "$curl_typeof_curl_off_t" = "unknown"; then
2959 AC_MSG_CHECKING([for 32-bit curl_off_t data type])
2965 DO_CURL_OFF_T_CHECK([$t4], [4])
2967 AC_MSG_RESULT([$curl_typeof_curl_off_t])
2969 if test "$curl_typeof_curl_off_t" = "unknown"; then
2970 AC_MSG_CHECKING([for 16-bit curl_off_t data type])
2976 DO_CURL_OFF_T_CHECK([$t2], [2])
2978 AC_MSG_RESULT([$curl_typeof_curl_off_t])
2980 if test "$curl_typeof_curl_off_t" = "unknown"; then
2981 AC_MSG_ERROR([cannot find data type for curl_off_t.])
2984 AC_MSG_CHECKING([size of curl_off_t])
2985 AC_MSG_RESULT([$curl_sizeof_curl_off_t])
2987 AC_MSG_CHECKING([formatting string directive for curl_off_t])
2988 if test "$curl_format_curl_off_t" != "unknown"; then
2989 x_pull_headers="yes"
2990 curl_format_curl_off_t=`echo "$curl_format_curl_off_t" | "$SED" 's/[["]]//g'`
2991 curl_format_curl_off_tu=`echo "$curl_format_curl_off_t" | "$SED" 's/i$/u/'`
2992 curl_format_curl_off_tu=`echo "$curl_format_curl_off_tu" | "$SED" 's/d$/u/'`
2993 curl_format_curl_off_tu=`echo "$curl_format_curl_off_tu" | "$SED" 's/D$/U/'`
2996 case AS_TR_SH([$curl_typeof_curl_off_t]) in
2997 long_long | __longlong | __longlong_t)
2998 curl_format_curl_off_t="lld"
2999 curl_format_curl_off_tu="llu"
3002 curl_format_curl_off_t="ld"
3003 curl_format_curl_off_tu="lu"
3006 curl_format_curl_off_t="d"
3007 curl_format_curl_off_tu="u"
3010 curl_format_curl_off_t="I64d"
3011 curl_format_curl_off_tu="I64u"
3014 curl_format_curl_off_t="I32d"
3015 curl_format_curl_off_tu="I32u"
3018 curl_format_curl_off_t="I16d"
3019 curl_format_curl_off_tu="I16u"
3022 AC_MSG_ERROR([cannot find print format string for curl_off_t.])
3026 AC_MSG_RESULT(["$curl_format_curl_off_t"])
3028 AC_MSG_CHECKING([formatting string directive for unsigned curl_off_t])
3029 AC_MSG_RESULT(["$curl_format_curl_off_tu"])
3031 DO_CURL_OFF_T_SUFFIX_CHECK([$curl_typeof_curl_off_t])
3033 if test "$x_pull_headers" = "yes"; then
3034 if test "x$ac_cv_header_sys_types_h" = "xyes"; then
3035 CURL_DEFINE_UNQUOTED([CURL_PULL_SYS_TYPES_H])
3037 if test "x$ac_cv_header_stdint_h" = "xyes"; then
3038 CURL_DEFINE_UNQUOTED([CURL_PULL_STDINT_H])
3040 if test "x$ac_cv_header_inttypes_h" = "xyes"; then
3041 CURL_DEFINE_UNQUOTED([CURL_PULL_INTTYPES_H])
3045 CURL_DEFINE_UNQUOTED([CURL_TYPEOF_CURL_OFF_T], [$curl_typeof_curl_off_t])
3046 CURL_DEFINE_UNQUOTED([CURL_FORMAT_CURL_OFF_T], ["$curl_format_curl_off_t"])
3047 CURL_DEFINE_UNQUOTED([CURL_FORMAT_CURL_OFF_TU], ["$curl_format_curl_off_tu"])
3048 CURL_DEFINE_UNQUOTED([CURL_FORMAT_OFF_T], ["%$curl_format_curl_off_t"])
3049 CURL_DEFINE_UNQUOTED([CURL_SIZEOF_CURL_OFF_T], [$curl_sizeof_curl_off_t])
3050 CURL_DEFINE_UNQUOTED([CURL_SUFFIX_CURL_OFF_T], [$curl_suffix_curl_off_t])
3051 CURL_DEFINE_UNQUOTED([CURL_SUFFIX_CURL_OFF_TU], [$curl_suffix_curl_off_tu])
3056 dnl CURL_CONFIGURE_CURL_SOCKLEN_T
3057 dnl -------------------------------------------------
3058 dnl Find out suitable curl_socklen_t data type definition and size, making
3059 dnl appropriate definitions for template file include/curl/curlbuild.h.in
3060 dnl to properly configure and use the library.
3062 dnl The need for the curl_socklen_t definition arises mainly to properly
3063 dnl interface HP-UX systems which on one hand have a typedef'ed socklen_t
3064 dnl data type which is 32 or 64-Bit wide depending on the data model being
3065 dnl used, and that on the other hand is only actually used when interfacing
3066 dnl the X/Open sockets provided in the xnet library.
3068 AC_DEFUN([CURL_CONFIGURE_CURL_SOCKLEN_T], [
3069 AC_REQUIRE([CURL_INCLUDES_WS2TCPIP])dnl
3070 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
3071 AC_REQUIRE([CURL_PREPROCESS_CALLCONV])dnl
3073 AC_MSG_CHECKING([for curl_socklen_t data type])
3074 curl_typeof_curl_socklen_t="unknown"
3075 for arg1 in int SOCKET; do
3076 for arg2 in 'struct sockaddr' void; do
3077 for t in socklen_t int size_t 'unsigned int' long 'unsigned long' void; do
3078 if test "$curl_typeof_curl_socklen_t" = "unknown"; then
3081 $curl_includes_ws2tcpip
3082 $curl_includes_sys_socket
3083 $curl_preprocess_callconv
3084 extern int FUNCALLCONV getpeername($arg1, $arg2 *, $t *);
3087 if(0 != getpeername(0, 0, lenptr))
3091 curl_typeof_curl_socklen_t="$t"
3097 for t in socklen_t int; do
3098 if test "$curl_typeof_curl_socklen_t" = "void"; then
3101 $curl_includes_sys_socket
3102 typedef $t curl_socklen_t;
3104 curl_socklen_t dummy;
3107 curl_typeof_curl_socklen_t="$t"
3111 AC_MSG_RESULT([$curl_typeof_curl_socklen_t])
3112 if test "$curl_typeof_curl_socklen_t" = "void" ||
3113 test "$curl_typeof_curl_socklen_t" = "unknown"; then
3114 AC_MSG_ERROR([cannot find data type for curl_socklen_t.])
3117 AC_MSG_CHECKING([size of curl_socklen_t])
3118 curl_sizeof_curl_socklen_t="unknown"
3119 curl_pull_headers_socklen_t="unknown"
3120 if test "$ac_cv_header_ws2tcpip_h" = "yes"; then
3121 tst_pull_header_checks='none ws2tcpip'
3124 tst_pull_header_checks='none systypes syssocket'
3125 tst_size_checks='4 8 2'
3127 for tst_size in $tst_size_checks; do
3128 for tst_pull_headers in $tst_pull_header_checks; do
3129 if test "$curl_sizeof_curl_socklen_t" = "unknown"; then
3130 case $tst_pull_headers in
3132 tmp_includes="$curl_includes_ws2tcpip"
3135 tmp_includes="$curl_includes_sys_types"
3138 tmp_includes="$curl_includes_sys_socket"
3147 typedef $curl_typeof_curl_socklen_t curl_socklen_t;
3148 typedef char dummy_arr[sizeof(curl_socklen_t) == $tst_size ? 1 : -1];
3150 curl_socklen_t dummy;
3153 curl_sizeof_curl_socklen_t="$tst_size"
3154 curl_pull_headers_socklen_t="$tst_pull_headers"
3159 AC_MSG_RESULT([$curl_sizeof_curl_socklen_t])
3160 if test "$curl_sizeof_curl_socklen_t" = "unknown"; then
3161 AC_MSG_ERROR([cannot find out size of curl_socklen_t.])
3164 case $curl_pull_headers_socklen_t in
3166 CURL_DEFINE_UNQUOTED([CURL_PULL_WS2TCPIP_H])
3169 CURL_DEFINE_UNQUOTED([CURL_PULL_SYS_TYPES_H])
3172 CURL_DEFINE_UNQUOTED([CURL_PULL_SYS_TYPES_H])
3173 CURL_DEFINE_UNQUOTED([CURL_PULL_SYS_SOCKET_H])
3176 CURL_DEFINE_UNQUOTED([CURL_TYPEOF_CURL_SOCKLEN_T], [$curl_typeof_curl_socklen_t])
3177 CURL_DEFINE_UNQUOTED([CURL_SIZEOF_CURL_SOCKLEN_T], [$curl_sizeof_curl_socklen_t])
3181 dnl CURL_CHECK_WIN32_LARGEFILE
3182 dnl -------------------------------------------------
3183 dnl Check if curl's WIN32 large file will be used
3185 AC_DEFUN([CURL_CHECK_WIN32_LARGEFILE], [
3186 AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
3187 AC_MSG_CHECKING([whether build target supports WIN32 file API])
3188 curl_win32_file_api="no"
3189 if test "$ac_cv_header_windows_h" = "yes"; then
3190 if test x"$enable_largefile" != "xno"; then
3194 #if !defined(_WIN32_WCE) && \
3195 (defined(__MINGW32__) || \
3196 (defined(_MSC_VER) && (defined(_WIN32) || defined(_WIN64))))
3199 WIN32 large file API not supported.
3203 curl_win32_file_api="win32_large_files"
3206 if test "$curl_win32_file_api" = "no"; then
3210 #if defined(_WIN32_WCE) || defined(__MINGW32__) || defined(_MSC_VER)
3213 WIN32 small file API not supported.
3217 curl_win32_file_api="win32_small_files"
3221 case "$curl_win32_file_api" in
3223 AC_MSG_RESULT([yes (large file enabled)])
3224 AC_DEFINE_UNQUOTED(USE_WIN32_LARGE_FILES, 1,
3225 [Define to 1 if you are building a Windows target with large file support.])
3228 AC_MSG_RESULT([yes (large file disabled)])
3229 AC_DEFINE_UNQUOTED(USE_WIN32_LARGE_FILES, 1,
3230 [Define to 1 if you are building a Windows target without large file support.])
3238 dnl CURL_CHECK_PKGCONFIG ($module)
3239 dnl ------------------------
3240 dnl search for the pkg-config tool (if not cross-compiling). Set the PKGCONFIG
3241 dnl variable to hold the path to it, or 'no' if not found/present.
3243 dnl If pkg-config is present, check that it has info about the $module or return
3247 AC_DEFUN([CURL_CHECK_PKGCONFIG], [
3248 if test x$cross_compiling != xyes; then
3249 dnl only do pkg-config magic when not cross-compiling
3250 AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
3252 if test x$PKGCONFIG != xno; then
3253 AC_MSG_CHECKING([for $1 options with pkg-config])
3254 dnl ask pkg-config about $1
3255 $PKGCONFIG --exists $1
3256 if test "$?" -ne "0"; then
3257 dnl pkg-config does not have info about the given module! set the
3258 dnl variable to 'no'
3262 AC_MSG_RESULT([found])