# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
+# SPDX-License-Identifier: curl
+#
#***************************************************************************
dnl CURL_CHECK_DEF (SYMBOL, [INCLUDES], [SILENT])
])
-dnl CURL_CHECK_HEADER_WINCRYPT
-dnl -------------------------------------------------
-dnl Check for compilable and valid wincrypt.h header
-
-AC_DEFUN([CURL_CHECK_HEADER_WINCRYPT], [
- AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
- AC_CACHE_CHECK([for wincrypt.h], [curl_cv_header_wincrypt_h], [
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
-#undef inline
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
-#endif
-#include <windows.h>
-#include <wincrypt.h>
- ]],[[
- int dummy=2*PROV_RSA_FULL;
- ]])
- ],[
- curl_cv_header_wincrypt_h="yes"
- ],[
- curl_cv_header_wincrypt_h="no"
- ])
- ])
- case "$curl_cv_header_wincrypt_h" in
- yes)
- AC_DEFINE_UNQUOTED(HAVE_WINCRYPT_H, 1,
- [Define to 1 if you have the wincrypt.h header file.])
- ;;
- esac
-])
-
-
-dnl CURL_CHECK_HEADER_WINLDAP
-dnl -------------------------------------------------
-dnl Check for compilable and valid winldap.h header
-
-AC_DEFUN([CURL_CHECK_HEADER_WINLDAP], [
- AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
- AC_CACHE_CHECK([for winldap.h], [curl_cv_header_winldap_h], [
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
-#undef inline
-#ifdef HAVE_WINDOWS_H
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
-#endif
-#include <windows.h>
-#endif
-#include <winldap.h>
- ]],[[
-#if defined(__CYGWIN__) || defined(__CEGCC__)
- HAVE_WINLDAP_H shall not be defined.
-#else
- LDAP *ldp = ldap_init("dummy", LDAP_PORT);
- ULONG res = ldap_unbind(ldp);
-#endif
- ]])
- ],[
- curl_cv_header_winldap_h="yes"
- ],[
- curl_cv_header_winldap_h="no"
- ])
- ])
- case "$curl_cv_header_winldap_h" in
- yes)
- AC_DEFINE_UNQUOTED(HAVE_WINLDAP_H, 1,
- [Define to 1 if you have the winldap.h header file.])
- ;;
- esac
-])
-
-
-dnl CURL_CHECK_HEADER_WINBER
-dnl -------------------------------------------------
-dnl Check for compilable and valid winber.h header
-
-AC_DEFUN([CURL_CHECK_HEADER_WINBER], [
- AC_REQUIRE([CURL_CHECK_HEADER_WINLDAP])dnl
- AC_CACHE_CHECK([for winber.h], [curl_cv_header_winber_h], [
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
-#undef inline
-#ifdef HAVE_WINDOWS_H
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
-#endif
-#include <windows.h>
-#endif
-#include <winldap.h>
-#include <winber.h>
- ]],[[
-#if defined(__CYGWIN__) || defined(__CEGCC__)
- HAVE_WINBER_H shall not be defined.
-#else
- BERVAL *bvp = NULL;
- BerElement *bep = ber_init(bvp);
- ber_free(bep, 1);
-#endif
- ]])
- ],[
- curl_cv_header_winber_h="yes"
- ],[
- curl_cv_header_winber_h="no"
- ])
- ])
- case "$curl_cv_header_winber_h" in
- yes)
- AC_DEFINE_UNQUOTED(HAVE_WINBER_H, 1,
- [Define to 1 if you have the winber.h header file.])
- ;;
- esac
-])
-
-
dnl CURL_CHECK_HEADER_LBER
dnl -------------------------------------------------
dnl Check for compilable and valid lber.h header,
#endif
#include <ldap.h>
]],[[
- LDAP *ldp = ldap_init("dummy", LDAP_PORT);
+ LDAP *ldp = ldap_init("0.0.0.0", LDAP_PORT);
int res = ldap_unbind(ldp);
]])
],[
#endif
#include <ldap_ssl.h>
]],[[
- LDAP *ldp = ldapssl_init("dummy", LDAPS_PORT, 1);
+ LDAP *ldp = ldapssl_init("0.0.0.0", LDAPS_PORT, 1);
]])
],[
curl_cv_header_ldap_ssl_h="yes"
])
-dnl CURL_CHECK_HEADER_LDAPSSL
-dnl -------------------------------------------------
-dnl Check for compilable and valid ldapssl.h header
-
-AC_DEFUN([CURL_CHECK_HEADER_LDAPSSL], [
- AC_REQUIRE([CURL_CHECK_HEADER_LDAP])dnl
- AC_CACHE_CHECK([for ldapssl.h], [curl_cv_header_ldapssl_h], [
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
-#undef inline
-#ifdef HAVE_WINDOWS_H
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
-#endif
-#include <windows.h>
-#else
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#endif
-#ifndef NULL
-#define NULL (void *)0
-#endif
-#ifndef LDAP_DEPRECATED
-#define LDAP_DEPRECATED 1
-#endif
-#ifdef NEED_LBER_H
-#include <lber.h>
-#endif
-#ifdef HAVE_LDAP_H
-#include <ldap.h>
-#endif
-#include <ldapssl.h>
- ]],[[
- char *cert_label = NULL;
- LDAP *ldp = ldap_ssl_init("dummy", LDAPS_PORT, cert_label);
- ]])
- ],[
- curl_cv_header_ldapssl_h="yes"
- ],[
- curl_cv_header_ldapssl_h="no"
- ])
- ])
- case "$curl_cv_header_ldapssl_h" in
- yes)
- AC_DEFINE_UNQUOTED(HAVE_LDAPSSL_H, 1,
- [Define to 1 if you have the ldapssl.h header file.])
- ;;
- esac
-])
-
-
dnl CURL_CHECK_LIBS_WINLDAP
dnl -------------------------------------------------
dnl Check for libraries needed for WINLDAP support,
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
-#ifdef HAVE_WINLDAP_H
#include <winldap.h>
-#endif
#ifdef HAVE_WINBER_H
#include <winber.h>
#endif
]],[[
BERVAL *bvp = NULL;
BerElement *bep = ber_init(bvp);
- LDAP *ldp = ldap_init("dummy", LDAP_PORT);
+ LDAP *ldp = ldap_init("0.0.0.0", LDAP_PORT);
ULONG res = ldap_unbind(ldp);
ber_free(bep, 1);
]])
]],[[
BerValue *bvp = NULL;
BerElement *bep = ber_init(bvp);
- LDAP *ldp = ldap_init("dummy", LDAP_PORT);
+ LDAP *ldp = ldap_init("0.0.0.0", LDAP_PORT);
int res = ldap_unbind(ldp);
ber_free(bep, 1);
]])
])
-dnl CURL_CHECK_HEADER_MALLOC
-dnl -------------------------------------------------
-dnl Check for compilable and valid malloc.h header,
-dnl and check if it is needed even with stdlib.h
-
-AC_DEFUN([CURL_CHECK_HEADER_MALLOC], [
- AC_CACHE_CHECK([for malloc.h], [curl_cv_header_malloc_h], [
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
-#include <malloc.h>
- ]],[[
- void *p = malloc(10);
- void *q = calloc(10,10);
- free(p);
- free(q);
- ]])
- ],[
- curl_cv_header_malloc_h="yes"
- ],[
- curl_cv_header_malloc_h="no"
- ])
- ])
- if test "$curl_cv_header_malloc_h" = "yes"; then
- AC_DEFINE_UNQUOTED(HAVE_MALLOC_H, 1,
- [Define to 1 if you have the malloc.h header file.])
- #
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
-#include <stdlib.h>
- ]],[[
- void *p = malloc(10);
- void *q = calloc(10,10);
- free(p);
- free(q);
- ]])
- ],[
- curl_cv_need_header_malloc_h="no"
- ],[
- curl_cv_need_header_malloc_h="yes"
- ])
- #
- case "$curl_cv_need_header_malloc_h" in
- yes)
- AC_DEFINE_UNQUOTED(NEED_MALLOC_H, 1,
- [Define to 1 if you need the malloc.h header file even with stdlib.h])
- ;;
- esac
- fi
-])
-
-
-dnl CURL_CHECK_HEADER_MEMORY
-dnl -------------------------------------------------
-dnl Check for compilable and valid memory.h header,
-dnl and check if it is needed even with stdlib.h for
-dnl memory related functions.
-
-AC_DEFUN([CURL_CHECK_HEADER_MEMORY], [
- AC_CACHE_CHECK([for memory.h], [curl_cv_header_memory_h], [
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
-#include <memory.h>
- ]],[[
- void *p = malloc(10);
- void *q = calloc(10,10);
- free(p);
- free(q);
- ]])
- ],[
- curl_cv_header_memory_h="yes"
- ],[
- curl_cv_header_memory_h="no"
- ])
- ])
- if test "$curl_cv_header_memory_h" = "yes"; then
- AC_DEFINE_UNQUOTED(HAVE_MEMORY_H, 1,
- [Define to 1 if you have the memory.h header file.])
- #
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
-#include <stdlib.h>
- ]],[[
- void *p = malloc(10);
- void *q = calloc(10,10);
- free(p);
- free(q);
- ]])
- ],[
- curl_cv_need_header_memory_h="no"
- ],[
- curl_cv_need_header_memory_h="yes"
- ])
- #
- case "$curl_cv_need_header_memory_h" in
- yes)
- AC_DEFINE_UNQUOTED(NEED_MEMORY_H, 1,
- [Define to 1 if you need the memory.h header file even with stdlib.h])
- ;;
- esac
- fi
-])
-
dnl TYPE_SOCKADDR_STORAGE
dnl -------------------------------------------------
dnl Check for struct sockaddr_storage. Most IPv6-enabled
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
-#include <windows.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
+#include <windows.h>
#else
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
dnl CURL_CHECK_FUNC_RECV
dnl -------------------------------------------------
dnl Test if the socket recv() function is available,
-dnl and check its return type and the types of its
-dnl arguments. If the function succeeds HAVE_RECV
-dnl will be defined, defining the types of the arguments
-dnl in RECV_TYPE_ARG1, RECV_TYPE_ARG2, RECV_TYPE_ARG3
-dnl and RECV_TYPE_ARG4, defining the type of the function
-dnl return value in RECV_TYPE_RETV.
AC_DEFUN([CURL_CHECK_FUNC_RECV], [
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
+ AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl
AC_CHECK_HEADERS(sys/types.h sys/socket.h)
#
AC_MSG_CHECKING([for recv])
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
-#include <windows.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
+#include <windows.h>
#else
-#ifdef HAVE_PROTO_BSDSOCKET_H
-#include <proto/bsdsocket.h>
-struct Library *SocketBase = NULL;
-#endif
+$curl_includes_bsdsocket
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
])
#
if test "$curl_cv_recv" = "yes"; then
- AC_CACHE_CHECK([types of args and return type for recv],
- [curl_cv_func_recv_args], [
- curl_cv_func_recv_args="unknown"
- for recv_retv in 'int' 'ssize_t'; do
- for recv_arg1 in 'int' 'ssize_t' 'SOCKET'; do
- for recv_arg2 in 'char *' 'void *'; do
- for recv_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do
- for recv_arg4 in 'int' 'unsigned int'; do
- if test "$curl_cv_func_recv_args" = "unknown"; then
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
-#undef inline
-#ifdef HAVE_WINDOWS_H
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
-#endif
-#include <windows.h>
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-#define RECVCALLCONV PASCAL
-#else
-#ifdef HAVE_PROTO_BSDSOCKET_H
-#include <proto/bsdsocket.h>
-struct Library *SocketBase = NULL;
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#define RECVCALLCONV
-#endif
-#ifndef HAVE_PROTO_BSDSOCKET_H
- extern $recv_retv RECVCALLCONV
- recv($recv_arg1, $recv_arg2, $recv_arg3, $recv_arg4);
-#endif
- ]],[[
- $recv_arg1 s=0;
- $recv_arg2 buf=0;
- $recv_arg3 len=0;
- $recv_arg4 flags=0;
- $recv_retv res = recv(s, buf, len, flags);
- ]])
- ],[
- curl_cv_func_recv_args="$recv_arg1,$recv_arg2,$recv_arg3,$recv_arg4,$recv_retv"
- ])
- fi
- done
- done
- done
- done
- done
- ]) # AC-CACHE-CHECK
- if test "$curl_cv_func_recv_args" = "unknown"; then
- AC_MSG_ERROR([Cannot find proper types to use for recv args])
- else
- recv_prev_IFS=$IFS; IFS=','
- set dummy `echo "$curl_cv_func_recv_args" | sed 's/\*/\*/g'`
- IFS=$recv_prev_IFS
- shift
- #
- AC_DEFINE_UNQUOTED(RECV_TYPE_ARG1, $[1],
- [Define to the type of arg 1 for recv.])
- AC_DEFINE_UNQUOTED(RECV_TYPE_ARG2, $[2],
- [Define to the type of arg 2 for recv.])
- AC_DEFINE_UNQUOTED(RECV_TYPE_ARG3, $[3],
- [Define to the type of arg 3 for recv.])
- AC_DEFINE_UNQUOTED(RECV_TYPE_ARG4, $[4],
- [Define to the type of arg 4 for recv.])
- AC_DEFINE_UNQUOTED(RECV_TYPE_RETV, $[5],
- [Define to the function return type for recv.])
- #
AC_DEFINE_UNQUOTED(HAVE_RECV, 1,
[Define to 1 if you have the recv function.])
curl_cv_func_recv="yes"
- fi
else
AC_MSG_ERROR([Unable to link function recv])
fi
dnl CURL_CHECK_FUNC_SEND
dnl -------------------------------------------------
dnl Test if the socket send() function is available,
-dnl and check its return type and the types of its
-dnl arguments. If the function succeeds HAVE_SEND
-dnl will be defined, defining the types of the arguments
-dnl in SEND_TYPE_ARG1, SEND_TYPE_ARG2, SEND_TYPE_ARG3
-dnl and SEND_TYPE_ARG4, defining the type of the function
-dnl return value in SEND_TYPE_RETV, and also defining the
-dnl type qualifier of second argument in SEND_QUAL_ARG2.
AC_DEFUN([CURL_CHECK_FUNC_SEND], [
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
+ AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl
AC_CHECK_HEADERS(sys/types.h sys/socket.h)
#
AC_MSG_CHECKING([for send])
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
-#include <windows.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
+#include <windows.h>
#else
-#ifdef HAVE_PROTO_BSDSOCKET_H
-#include <proto/bsdsocket.h>
-struct Library *SocketBase = NULL;
-#endif
+$curl_includes_bsdsocket
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
])
#
if test "$curl_cv_send" = "yes"; then
- AC_CACHE_CHECK([types of args and return type for send],
- [curl_cv_func_send_args], [
- curl_cv_func_send_args="unknown"
- for send_retv in 'int' 'ssize_t'; do
- for send_arg1 in 'int' 'ssize_t' 'SOCKET'; do
- for send_arg2 in 'char *' 'void *' 'const char *' 'const void *'; do
- for send_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do
- for send_arg4 in 'int' 'unsigned int'; do
- if test "$curl_cv_func_send_args" = "unknown"; then
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
-#undef inline
-#ifdef HAVE_WINDOWS_H
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
-#endif
-#include <windows.h>
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-#define SENDCALLCONV PASCAL
-#else
-#ifdef HAVE_PROTO_BSDSOCKET_H
-#include <proto/bsdsocket.h>
-struct Library *SocketBase = NULL;
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#define SENDCALLCONV
-#endif
-#ifndef HAVE_PROTO_BSDSOCKET_H
- extern $send_retv SENDCALLCONV
- send($send_arg1, $send_arg2, $send_arg3, $send_arg4);
-#endif
- ]],[[
- $send_arg1 s=0;
- $send_arg3 len=0;
- $send_arg4 flags=0;
- $send_retv res = send(s, 0, len, flags);
- ]])
- ],[
- curl_cv_func_send_args="$send_arg1,$send_arg2,$send_arg3,$send_arg4,$send_retv"
- ])
- fi
- done
- done
- done
- done
- done
- ]) # AC-CACHE-CHECK
- if test "$curl_cv_func_send_args" = "unknown"; then
- AC_MSG_ERROR([Cannot find proper types to use for send args])
- else
- send_prev_IFS=$IFS; IFS=','
- set dummy `echo "$curl_cv_func_send_args" | sed 's/\*/\*/g'`
- IFS=$send_prev_IFS
- shift
- #
- send_qual_type_arg2=$[2]
- #
- AC_DEFINE_UNQUOTED(SEND_TYPE_ARG1, $[1],
- [Define to the type of arg 1 for send.])
- AC_DEFINE_UNQUOTED(SEND_TYPE_ARG3, $[3],
- [Define to the type of arg 3 for send.])
- AC_DEFINE_UNQUOTED(SEND_TYPE_ARG4, $[4],
- [Define to the type of arg 4 for send.])
- AC_DEFINE_UNQUOTED(SEND_TYPE_RETV, $[5],
- [Define to the function return type for send.])
- #
- prev_sh_opts=$-
- #
- case $prev_sh_opts in
- *f*)
- ;;
- *)
- set -f
- ;;
- esac
- #
- case "$send_qual_type_arg2" in
- const*)
- send_qual_arg2=const
- send_type_arg2=`echo $send_qual_type_arg2 | sed 's/^const //'`
- ;;
- *)
- send_qual_arg2=
- send_type_arg2=$send_qual_type_arg2
- ;;
- esac
- #
- AC_DEFINE_UNQUOTED(SEND_QUAL_ARG2, $send_qual_arg2,
- [Define to the type qualifier of arg 2 for send.])
- AC_DEFINE_UNQUOTED(SEND_TYPE_ARG2, $send_type_arg2,
- [Define to the type of arg 2 for send.])
- #
- case $prev_sh_opts in
- *f*)
- ;;
- *)
- set +f
- ;;
- esac
- #
- AC_DEFINE_UNQUOTED(HAVE_SEND, 1,
- [Define to 1 if you have the send function.])
- curl_cv_func_send="yes"
- fi
+ AC_DEFINE_UNQUOTED(HAVE_SEND, 1,
+ [Define to 1 if you have the send function.])
+ curl_cv_func_send="yes"
else
AC_MSG_ERROR([Unable to link function send])
fi
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
-#include <windows.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
+#include <windows.h>
#else
-#ifdef HAVE_PROTO_BSDSOCKET_H
-#include <proto/bsdsocket.h>
-struct Library *SocketBase = NULL;
-#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
-#include <windows.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
+#include <windows.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
-#include <windows.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
+#include <windows.h>
#else
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
-#include <windows.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
+#include <windows.h>
#else
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
dnl until library linking and run-time checks for clock_gettime succeed.
])
+dnl CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC_RAW
+dnl -------------------------------------------------
+dnl Check if monotonic clock_gettime is available.
+
+AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC_RAW], [
+ AC_CHECK_HEADERS(sys/types.h sys/time.h)
+ AC_MSG_CHECKING([for raw monotonic clock_gettime])
+ #
+ if test "x$dontwant_rt" = "xno" ; then
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <time.h>
+ ]],[[
+ struct timespec ts;
+ (void)clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
+ ]])
+ ],[
+ AC_MSG_RESULT([yes])
+ AC_DEFINE_UNQUOTED(HAVE_CLOCK_GETTIME_MONOTONIC_RAW, 1,
+ [Define to 1 if you have the clock_gettime function and raw monotonic timer.])
+ ],[
+ AC_MSG_RESULT([no])
+ ])
+ fi
+])
+
dnl CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
dnl -------------------------------------------------
AC_MSG_CHECKING([if monotonic clock_gettime works])
CURL_RUN_IFELSE([
AC_LANG_PROGRAM([[
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
dnl CURL_CHECK_FUNC_SELECT
dnl -------------------------------------------------
-dnl Test if the socket select() function is available,
-dnl and check its return type and the types of its
-dnl arguments. If the function succeeds HAVE_SELECT
-dnl will be defined, defining the types of the
-dnl arguments in SELECT_TYPE_ARG1, SELECT_TYPE_ARG234
-dnl and SELECT_TYPE_ARG5, defining the type of the
-dnl function return value in SELECT_TYPE_RETV, and
-dnl also defining the type qualifier of fifth argument
-dnl in SELECT_QUAL_ARG5.
+dnl Test if the socket select() function is available.
AC_DEFUN([CURL_CHECK_FUNC_SELECT], [
AC_REQUIRE([CURL_CHECK_STRUCT_TIMEVAL])dnl
+ AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl
AC_CHECK_HEADERS(sys/select.h sys/socket.h)
#
AC_MSG_CHECKING([for select])
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
-#include <windows.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
+#include <windows.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
-#ifdef HAVE_PROTO_BSDSOCKET_H
-#include <proto/bsdsocket.h>
-struct Library *SocketBase = NULL;
-#define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0)
-#endif
+$curl_includes_bsdsocket
#endif
]],[[
select(0, 0, 0, 0, 0);
])
#
if test "$curl_cv_select" = "yes"; then
- AC_CACHE_CHECK([types of args and return type for select],
- [curl_cv_func_select_args], [
- curl_cv_func_select_args="unknown"
- for sel_retv in 'int' 'ssize_t'; do
- for sel_arg1 in 'int' 'ssize_t' 'size_t' 'unsigned long int' 'unsigned int'; do
- for sel_arg234 in 'fd_set *' 'int *' 'void *'; do
- for sel_arg5 in 'struct timeval *' 'const struct timeval *'; do
- if test "$curl_cv_func_select_args" = "unknown"; then
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
-#undef inline
-#ifdef HAVE_WINDOWS_H
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
-#endif
-#include <windows.h>
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-#define SELECTCALLCONV PASCAL
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#include <time.h>
-#ifndef HAVE_WINDOWS_H
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#elif defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_PROTO_BSDSOCKET_H
-#include <proto/bsdsocket.h>
-struct Library *SocketBase = NULL;
-#define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0)
-#endif
-#define SELECTCALLCONV
-#endif
-#ifndef HAVE_STRUCT_TIMEVAL
- struct timeval {
- long tv_sec;
- long tv_usec;
- };
-#endif
-#ifndef HAVE_PROTO_BSDSOCKET_H
- extern $sel_retv SELECTCALLCONV
- select($sel_arg1,
- $sel_arg234,
- $sel_arg234,
- $sel_arg234,
- $sel_arg5);
-#endif
- ]],[[
- $sel_arg1 nfds=0;
- $sel_arg234 rfds=0;
- $sel_arg234 wfds=0;
- $sel_arg234 efds=0;
- $sel_retv res = select(nfds, rfds, wfds, efds, 0);
- ]])
- ],[
- curl_cv_func_select_args="$sel_arg1,$sel_arg234,$sel_arg5,$sel_retv"
- ])
- fi
- done
- done
- done
- done
- ]) # AC-CACHE-CHECK
- if test "$curl_cv_func_select_args" = "unknown"; then
- AC_MSG_WARN([Cannot find proper types to use for select args])
- AC_MSG_WARN([HAVE_SELECT will not be defined])
- else
- select_prev_IFS=$IFS; IFS=','
- set dummy `echo "$curl_cv_func_select_args" | sed 's/\*/\*/g'`
- IFS=$select_prev_IFS
- shift
- #
- sel_qual_type_arg5=$[3]
- #
- AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG1, $[1],
- [Define to the type of arg 1 for select.])
- AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG234, $[2],
- [Define to the type of args 2, 3 and 4 for select.])
- AC_DEFINE_UNQUOTED(SELECT_TYPE_RETV, $[4],
- [Define to the function return type for select.])
- #
- prev_sh_opts=$-
- #
- case $prev_sh_opts in
- *f*)
- ;;
- *)
- set -f
- ;;
- esac
- #
- case "$sel_qual_type_arg5" in
- const*)
- sel_qual_arg5=const
- sel_type_arg5=`echo $sel_qual_type_arg5 | sed 's/^const //'`
- ;;
- *)
- sel_qual_arg5=
- sel_type_arg5=$sel_qual_type_arg5
- ;;
- esac
- #
- AC_DEFINE_UNQUOTED(SELECT_QUAL_ARG5, $sel_qual_arg5,
- [Define to the type qualifier of arg 5 for select.])
- AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5, $sel_type_arg5,
- [Define to the type of arg 5 for select.])
- #
- case $prev_sh_opts in
- *f*)
- ;;
- *)
- set +f
- ;;
- esac
- #
- AC_DEFINE_UNQUOTED(HAVE_SELECT, 1,
- [Define to 1 if you have the select function.])
- curl_cv_func_select="yes"
- fi
+ AC_DEFINE_UNQUOTED(HAVE_SELECT, 1,
+ [Define to 1 if you have the select function.])
+ curl_cv_func_select="yes"
fi
])
])
-dnl CURL_CHECK_VARIADIC_MACROS
-dnl -------------------------------------------------
-dnl Check compiler support of variadic macros
-
-AC_DEFUN([CURL_CHECK_VARIADIC_MACROS], [
- AC_CACHE_CHECK([for compiler support of C99 variadic macro style],
- [curl_cv_variadic_macros_c99], [
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
-#define c99_vmacro3(first, ...) fun3(first, __VA_ARGS__)
-#define c99_vmacro2(first, ...) fun2(first, __VA_ARGS__)
- int fun3(int arg1, int arg2, int arg3);
- int fun2(int arg1, int arg2);
- int fun3(int arg1, int arg2, int arg3)
- { return arg1 + arg2 + arg3; }
- int fun2(int arg1, int arg2)
- { return arg1 + arg2; }
- ]],[[
- int res3 = c99_vmacro3(1, 2, 3);
- int res2 = c99_vmacro2(1, 2);
- ]])
- ],[
- curl_cv_variadic_macros_c99="yes"
- ],[
- curl_cv_variadic_macros_c99="no"
- ])
- ])
- case "$curl_cv_variadic_macros_c99" in
- yes)
- AC_DEFINE_UNQUOTED(HAVE_VARIADIC_MACROS_C99, 1,
- [Define to 1 if compiler supports C99 variadic macro style.])
- ;;
- esac
- AC_CACHE_CHECK([for compiler support of old gcc variadic macro style],
- [curl_cv_variadic_macros_gcc], [
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
-#define gcc_vmacro3(first, args...) fun3(first, args)
-#define gcc_vmacro2(first, args...) fun2(first, args)
- int fun3(int arg1, int arg2, int arg3);
- int fun2(int arg1, int arg2);
- int fun3(int arg1, int arg2, int arg3)
- { return arg1 + arg2 + arg3; }
- int fun2(int arg1, int arg2)
- { return arg1 + arg2; }
- ]],[[
- int res3 = gcc_vmacro3(1, 2, 3);
- int res2 = gcc_vmacro2(1, 2);
- ]])
- ],[
- curl_cv_variadic_macros_gcc="yes"
- ],[
- curl_cv_variadic_macros_gcc="no"
- ])
- ])
- case "$curl_cv_variadic_macros_gcc" in
- yes)
- AC_DEFINE_UNQUOTED(HAVE_VARIADIC_MACROS_GCC, 1,
- [Define to 1 if compiler supports old gcc variadic macro style.])
- ;;
- esac
-])
-
-
dnl CURL_CHECK_CA_BUNDLE
dnl -------------------------------------------------
dnl Check if a default ca-bundle should be used
dnl /etc/ssl/certs/ca-certificates.crt Debian systems
dnl /etc/pki/tls/certs/ca-bundle.crt Redhat and Mandriva
dnl /usr/share/ssl/certs/ca-bundle.crt old(er) Redhat
-dnl /usr/local/share/certs/ca-root-nss.crt FreeBSD, MidnightBSD
-dnl /etc/ssl/cert.pem OpenBSD, FreeBSD, MidnightBSD (symlink)
-dnl /etc/ssl/certs/ (ca path) SUSE
+dnl /usr/local/share/certs/ca-root-nss.crt MidnightBSD
+dnl /etc/ssl/cert.pem OpenBSD, MidnightBSD (symlink)
+dnl /etc/ssl/certs (CA path) SUSE, FreeBSD
AC_DEFUN([CURL_CHECK_CA_BUNDLE], [
AS_HELP_STRING([--with-ca-path=DIRECTORY],
[Path to a directory containing CA certificates stored individually, with \
their filenames in a hash format. This option can be used with the OpenSSL, \
-GnuTLS and mbedTLS backends. Refer to OpenSSL c_rehash for details. \
+GnuTLS, mbedTLS and wolfSSL backends. Refer to OpenSSL c_rehash for details. \
(example: /etc/certificates)])
AS_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
[
capath="no"
elif test "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then
dnl --with-ca-path given
- if test "x$OPENSSL_ENABLED" != "x1" -a "x$GNUTLS_ENABLED" != "x1" -a "x$MBEDTLS_ENABLED" != "x1"; then
- AC_MSG_ERROR([--with-ca-path only works with OpenSSL, GnuTLS or mbedTLS])
+ if test "x$OPENSSL_ENABLED" != "x1" -a \
+ "x$GNUTLS_ENABLED" != "x1" -a \
+ "x$MBEDTLS_ENABLED" != "x1" -a \
+ "x$WOLFSSL_ENABLED" != "x1"; then
+ AC_MSG_ERROR([--with-ca-path only works with OpenSSL, GnuTLS, mbedTLS or wolfSSL])
fi
capath="$want_capath"
ca="no"
fi
done
fi
- if test "x$want_capath" = "xunset" -a "x$ca" = "xno" -a \
- "x$OPENSSL_ENABLED" = "x1"; then
- check_capath="/etc/ssl/certs/"
+ AC_MSG_NOTICE([want $want_capath ca $ca])
+ if test "x$want_capath" = "xunset"; then
+ if test "x$OPENSSL_ENABLED" = "x1" -o \
+ "x$GNUTLS_ENABLED" = "x1" -o \
+ "x$MBEDTLS_ENABLED" = "x1" -o \
+ "x$WOLFSSL_ENABLED" = "x1"; then
+ check_capath="/etc/ssl/certs"
+ fi
fi
else
dnl no option given and cross-compiling
dnl Check if curl's WIN32 crypto lib can be used
AC_DEFUN([CURL_CHECK_WIN32_CRYPTO], [
- AC_REQUIRE([CURL_CHECK_HEADER_WINCRYPT])dnl
+ AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
AC_MSG_CHECKING([whether build target supports WIN32 crypto API])
curl_win32_crypto_api="no"
- if test "$curl_cv_header_wincrypt_h" = "yes"; then
+ if test "$curl_cv_header_windows_h" = "yes"; then
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#undef inline