AC_DEFUN([CURL_CHECK_HEADER_WINDOWS], [
AC_CACHE_CHECK([for windows.h], [ac_cv_header_windows_h], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
- ],[
+ ]],[[
#if defined(__CYGWIN__) || defined(__CEGCC__)
HAVE_WINDOWS_H shall not be defined.
#else
int dummy=2*WINVER;
#endif
- ])
+ ]])
],[
ac_cv_header_windows_h="yes"
],[
ac_cv_native_windows="no"
else
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
- ],[
+ AC_LANG_PROGRAM([[
+ ]],[[
#if defined(__MINGW32__) || defined(__MINGW32CE__)
int dummy=1;
#else
Not a native Windows build target.
#endif
- ])
+ ]])
],[
ac_cv_native_windows="yes"
],[
AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
AC_CACHE_CHECK([for winsock.h], [ac_cv_header_winsock_h], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <winsock.h>
- ],[
+ ]],[[
#if defined(__CYGWIN__) || defined(__CEGCC__)
HAVE_WINSOCK_H shall not be defined.
#else
int dummy=WSACleanup();
#endif
- ])
+ ]])
],[
ac_cv_header_winsock_h="yes"
],[
AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
AC_CACHE_CHECK([for winsock2.h], [ac_cv_header_winsock2_h], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <winsock2.h>
- ],[
+ ]],[[
#if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__)
HAVE_WINSOCK2_H shall not be defined.
#else
int dummy=2*IPPROTO_ESP;
#endif
- ])
+ ]])
],[
ac_cv_header_winsock2_h="yes"
],[
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
AC_CACHE_CHECK([for ws2tcpip.h], [ac_cv_header_ws2tcpip_h], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
- ],[
+ ]],[[
#if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__)
HAVE_WS2TCPIP_H shall not be defined.
#else
int dummy=2*IP_PKTINFO;
#endif
- ])
+ ]])
],[
ac_cv_header_ws2tcpip_h="yes"
],[
AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
AC_CACHE_CHECK([for winldap.h], [ac_cv_header_winldap_h], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#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
- ])
+ ]])
],[
ac_cv_header_winldap_h="yes"
],[
AC_REQUIRE([CURL_CHECK_HEADER_WINLDAP])dnl
AC_CACHE_CHECK([for winber.h], [ac_cv_header_winber_h], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#endif
#include <winldap.h>
#include <winber.h>
- ],[
+ ]],[[
#if defined(__CYGWIN__) || defined(__CEGCC__)
HAVE_WINBER_H shall not be defined.
#else
BerElement *bep = ber_init(bvp);
ber_free(bep, 1);
#endif
- ])
+ ]])
],[
ac_cv_header_winber_h="yes"
],[
AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
AC_CACHE_CHECK([for lber.h], [ac_cv_header_lber_h], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#define NULL (void *)0
#endif
#include <lber.h>
- ],[
+ ]],[[
BerValue *bvp = NULL;
BerElement *bep = ber_init(bvp);
ber_free(bep, 1);
- ])
+ ]])
],[
ac_cv_header_lber_h="yes"
],[
[Define to 1 if you have the lber.h header file.])
#
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#define LDAP_DEPRECATED 1
#endif
#include <ldap.h>
- ],[
+ ]],[[
BerValue *bvp = NULL;
BerElement *bep = ber_init(bvp);
ber_free(bep, 1);
- ])
+ ]])
],[
curl_cv_need_header_lber_h="no"
],[
AC_REQUIRE([CURL_CHECK_HEADER_LBER])dnl
AC_CACHE_CHECK([for ldap.h], [ac_cv_header_ldap_h], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#include <lber.h>
#endif
#include <ldap.h>
- ],[
+ ]],[[
LDAP *ldp = ldap_init("dummy", LDAP_PORT);
int res = ldap_unbind(ldp);
- ])
+ ]])
],[
ac_cv_header_ldap_h="yes"
],[
AC_REQUIRE([CURL_CHECK_HEADER_LDAP])dnl
AC_CACHE_CHECK([for ldap_ssl.h], [ac_cv_header_ldap_ssl_h], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#include <ldap.h>
#endif
#include <ldap_ssl.h>
- ],[
+ ]],[[
LDAP *ldp = ldapssl_init("dummy", LDAPS_PORT, 1);
- ])
+ ]])
],[
ac_cv_header_ldap_ssl_h="yes"
],[
AC_REQUIRE([CURL_CHECK_HEADER_LDAP])dnl
AC_CACHE_CHECK([for ldapssl.h], [ac_cv_header_ldapssl_h], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#include <ldap.h>
#endif
#include <ldapssl.h>
- ],[
+ ]],[[
char *cert_label = NULL;
LDAP *ldp = ldap_ssl_init("dummy", LDAPS_PORT, cert_label);
- ])
+ ]])
],[
ac_cv_header_ldapssl_h="yes"
],[
LIBS="$x_nlibs $curl_cv_save_LIBS"
fi
AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#include <winber.h>
#endif
#endif
- ],[
+ ]],[[
BERVAL *bvp = NULL;
BerElement *bep = ber_init(bvp);
LDAP *ldp = ldap_init("dummy", LDAP_PORT);
ULONG res = ldap_unbind(ldp);
ber_free(bep, 1);
- ])
+ ]])
],[
curl_cv_ldap_LIBS="$x_nlibs"
break
LIBS="$x_nlibs $curl_cv_save_LIBS"
fi
AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
- ],[
+ ]],[[
BerValue *bvp = NULL;
BerElement *bep = ber_init(bvp);
LDAP *ldp = ldap_init("dummy", LDAP_PORT);
int res = ldap_unbind(ldp);
ber_free(bep, 1);
- ])
+ ]])
],[
curl_cv_ldap_LIBS="$x_nlibs"
break
AC_DEFUN([CURL_CHECK_HEADER_MALLOC], [
AC_CACHE_CHECK([for malloc.h], [ac_cv_header_malloc_h], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#include <malloc.h>
- ],[
+ ]],[[
void *p = malloc(10);
void *q = calloc(10,10);
free(p);
free(q);
- ])
+ ]])
],[
ac_cv_header_malloc_h="yes"
],[
[Define to 1 if you have the malloc.h header file.])
#
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ 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"
],[
for arg2 in "struct sockaddr" void; do
for t in int size_t unsigned long "unsigned long"; do
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#define GETPEERNCALLCONV
#endif
extern int GETPEERNCALLCONV getpeername ($arg1, $arg2 *, $t *);
- ],[
+ ]],[[
$t len=0;
getpeername(0,0,&len);
- ])
+ ]])
],[
curl_cv_socklen_t_equiv="$t"
break 3
if test "$curl_cv_getnameinfo" != "yes"; then
AC_MSG_CHECKING([deeper for getnameinfo])
AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
- ],[
+ AC_LANG_PROGRAM([[
+ ]],[[
getnameinfo();
- ])
+ ]])
],[
AC_MSG_RESULT([yes])
curl_cv_getnameinfo="yes"
if test "$curl_cv_getnameinfo" != "yes"; then
AC_MSG_CHECKING([deeper and deeper for getnameinfo])
AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#include <netdb.h>
#endif
#endif
- ],[
+ ]],[[
getnameinfo(0, 0, 0, 0, 0, 0, 0);
- ])
+ ]])
],[
AC_MSG_RESULT([yes])
curl_cv_getnameinfo="yes"
for gni_arg46 in 'size_t' 'int' 'socklen_t' 'unsigned int' 'DWORD'; do
for gni_arg7 in 'int' 'unsigned int'; do
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
char *, $gni_arg46,
char *, $gni_arg46,
$gni_arg7);
- ],[
+ ]],[[
$gni_arg2 salen=0;
$gni_arg46 hostlen=0;
$gni_arg46 servlen=0;
$gni_arg7 flags=0;
int res = getnameinfo(0, salen, 0, hostlen, 0, servlen, flags);
- ])
+ ]])
],[
curl_cv_func_getnameinfo_args="$gni_arg1,$gni_arg2,$gni_arg46,$gni_arg7"
break 4
AC_CACHE_CHECK([for working NI_WITHSCOPEID],
[ac_cv_working_ni_withscopeid], [
AC_RUN_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
- ],[
+ ]],[[
#if defined(NI_WITHSCOPEID) && defined(HAVE_GETNAMEINFO)
#ifdef HAVE_STRUCT_SOCKADDR_STORAGE
struct sockaddr_storage sa;
#else
return 4; /* Error, NI_WITHSCOPEID not defined or no getnameinfo() */
#endif
- ]) # AC_LANG_PROGRAM
+ ]]) # AC_LANG_PROGRAM
],[
# Exit code == 0. Program worked.
ac_cv_working_ni_withscopeid="yes"
# Program is not run when cross-compiling. So we assume
# NI_WITHSCOPEID will work if we are able to compile it.
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
- ],[
+ ]],[[
unsigned int dummy= NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID;
- ])
+ ]])
],[
ac_cv_working_ni_withscopeid="yes"
],[
#
AC_MSG_CHECKING([for recv])
AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#include <sys/socket.h>
#endif
#endif
- ],[
+ ]],[[
recv(0, 0, 0, 0);
- ])
+ ]])
],[
AC_MSG_RESULT([yes])
curl_cv_recv="yes"
for recv_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do
for recv_arg4 in 'int' 'unsigned int'; do
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#define RECVCALLCONV
#endif
extern $recv_retv RECVCALLCONV recv($recv_arg1, $recv_arg2, $recv_arg3, $recv_arg4);
- ],[
+ ]],[[
$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"
break 5
#
AC_MSG_CHECKING([for send])
AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#include <sys/socket.h>
#endif
#endif
- ],[
+ ]],[[
send(0, 0, 0, 0);
- ])
+ ]])
],[
AC_MSG_RESULT([yes])
curl_cv_send="yes"
for send_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do
for send_arg4 in 'int' 'unsigned int'; do
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#define SENDCALLCONV
#endif
extern $send_retv SENDCALLCONV send($send_arg1, $send_arg2, $send_arg3, $send_arg4);
- ],[
+ ]],[[
$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"
break 5
AC_CHECK_HEADERS(sys/types.h sys/socket.h)
AC_CACHE_CHECK([for MSG_NOSIGNAL], [ac_cv_msg_nosignal], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#include <sys/socket.h>
#endif
#endif
- ],[
+ ]],[[
int flag=MSG_NOSIGNAL;
- ])
+ ]])
],[
ac_cv_msg_nosignal="yes"
],[
AC_CHECK_HEADERS(sys/types.h sys/time.h time.h)
AC_CACHE_CHECK([for struct timeval], [ac_cv_struct_timeval], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#include <time.h>
#endif
#endif
- ],[
+ ]],[[
struct timeval ts;
ts.tv_sec = 0;
ts.tv_usec = 0;
- ])
+ ]])
],[
ac_cv_struct_timeval="yes"
],[
#
AC_MSG_CHECKING([if sig_atomic_t is already defined as volatile])
AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
- ],[
+ ]],[[
static volatile sig_atomic_t dummy = 0;
- ])
+ ]])
],[
AC_MSG_RESULT([no])
ac_cv_sig_atomic_t_volatile="no"
curl_cv_in_addr_t_equiv=
for t in "unsigned long" int size_t unsigned long; do
AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#include <arpa/inet.h>
#endif
#endif
- ],[
+ ]],[[
$t data = inet_addr ("1.2.3.4");
- ])
+ ]])
],[
curl_cv_in_addr_t_equiv="$t"
break
AC_CHECK_HEADERS(sys/types.h sys/time.h time.h)
AC_MSG_CHECKING([for monotonic clock_gettime])
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <time.h>
#endif
#endif
- ],[
+ ]],[[
struct timespec ts;
(void)clock_gettime(CLOCK_MONOTONIC, &ts);
- ])
+ ]])
],[
AC_MSG_RESULT([yes])
ac_cv_func_clock_gettime="yes"
LIBS="$x_xlibs $curl_cv_save_LIBS"
fi
AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <time.h>
#endif
#endif
- ],[
+ ]],[[
struct timespec ts;
(void)clock_gettime(CLOCK_MONOTONIC, &ts);
- ])
+ ]])
],[
curl_cv_gclk_LIBS="$x_xlibs"
break
#
AC_MSG_CHECKING([for select])
AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#include <sys/socket.h>
#endif
#endif
- ],[
+ ]],[[
select(0, 0, 0, 0, 0);
- ])
+ ]])
],[
AC_MSG_RESULT([yes])
curl_cv_select="yes"
for sel_arg234 in 'fd_set *' 'int *' 'void *'; do
for sel_arg5 in 'struct timeval *' 'const struct timeval *'; do
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
$sel_arg234,
$sel_arg234,
$sel_arg5);
- ],[
+ ]],[[
$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"
break 4
AC_CACHE_CHECK([for compiler support of C99 variadic macro style],
[curl_cv_variadic_macros_c99], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ 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);
{ 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"
],[
AC_CACHE_CHECK([for compiler support of old gcc variadic macro style],
[curl_cv_variadic_macros_gcc], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ 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);
{ 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"
],[
AC_DEFUN([CURL_CHECK_HEADER_WINDOWS], [
AC_CACHE_CHECK([for windows.h], [ac_cv_header_windows_h], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
- ],[
+ ]],[[
#if defined(__CYGWIN__) || defined(__CEGCC__)
HAVE_WINDOWS_H shall not be defined.
#else
int dummy=2*WINVER;
#endif
- ])
+ ]])
],[
ac_cv_header_windows_h="yes"
],[
ac_cv_native_windows="no"
else
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
- ],[
+ AC_LANG_PROGRAM([[
+ ]],[[
#if defined(__MINGW32__) || defined(__MINGW32CE__)
int dummy=1;
#else
Not a native Windows build target.
#endif
- ])
+ ]])
],[
ac_cv_native_windows="yes"
],[
AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
AC_CACHE_CHECK([for winsock.h], [ac_cv_header_winsock_h], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <winsock.h>
- ],[
+ ]],[[
#if defined(__CYGWIN__) || defined(__CEGCC__)
HAVE_WINSOCK_H shall not be defined.
#else
int dummy=WSACleanup();
#endif
- ])
+ ]])
],[
ac_cv_header_winsock_h="yes"
],[
AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
AC_CACHE_CHECK([for winsock2.h], [ac_cv_header_winsock2_h], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <winsock2.h>
- ],[
+ ]],[[
#if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__)
HAVE_WINSOCK2_H shall not be defined.
#else
int dummy=2*IPPROTO_ESP;
#endif
- ])
+ ]])
],[
ac_cv_header_winsock2_h="yes"
],[
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
AC_CACHE_CHECK([for ws2tcpip.h], [ac_cv_header_ws2tcpip_h], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
- ],[
+ ]],[[
#if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__)
HAVE_WS2TCPIP_H shall not be defined.
#else
int dummy=2*IP_PKTINFO;
#endif
- ])
+ ]])
],[
ac_cv_header_ws2tcpip_h="yes"
],[
AC_DEFUN([CURL_CHECK_HEADER_MALLOC], [
AC_CACHE_CHECK([for malloc.h], [ac_cv_header_malloc_h], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#include <malloc.h>
- ],[
+ ]],[[
void *p = malloc(10);
void *q = calloc(10,10);
free(p);
free(q);
- ])
+ ]])
],[
ac_cv_header_malloc_h="yes"
],[
[Define to 1 if you have the malloc.h header file.])
#
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ 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"
],[
for arg2 in "struct sockaddr" void; do
for t in int size_t unsigned long "unsigned long"; do
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#define GETPEERNCALLCONV
#endif
extern int GETPEERNCALLCONV getpeername ($arg1, $arg2 *, $t *);
- ],[
+ ]],[[
$t len=0;
getpeername(0,0,&len);
- ])
+ ]])
],[
curl_cv_socklen_t_equiv="$t"
break 3
if test "$curl_cv_getnameinfo" != "yes"; then
AC_MSG_CHECKING([deeper for getnameinfo])
AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
- ],[
+ AC_LANG_PROGRAM([[
+ ]],[[
getnameinfo();
- ])
+ ]])
],[
AC_MSG_RESULT([yes])
curl_cv_getnameinfo="yes"
if test "$curl_cv_getnameinfo" != "yes"; then
AC_MSG_CHECKING([deeper and deeper for getnameinfo])
AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#include <netdb.h>
#endif
#endif
- ],[
+ ]],[[
getnameinfo(0, 0, 0, 0, 0, 0, 0);
- ])
+ ]])
],[
AC_MSG_RESULT([yes])
curl_cv_getnameinfo="yes"
for gni_arg46 in 'size_t' 'int' 'socklen_t' 'unsigned int' 'DWORD'; do
for gni_arg7 in 'int' 'unsigned int'; do
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
char *, $gni_arg46,
char *, $gni_arg46,
$gni_arg7);
- ],[
+ ]],[[
$gni_arg2 salen=0;
$gni_arg46 hostlen=0;
$gni_arg46 servlen=0;
$gni_arg7 flags=0;
int res = getnameinfo(0, salen, 0, hostlen, 0, servlen, flags);
- ])
+ ]])
],[
curl_cv_func_getnameinfo_args="$gni_arg1,$gni_arg2,$gni_arg46,$gni_arg7"
break 4
AC_CACHE_CHECK([for working NI_WITHSCOPEID],
[ac_cv_working_ni_withscopeid], [
AC_RUN_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
- ],[
+ ]],[[
#if defined(NI_WITHSCOPEID) && defined(HAVE_GETNAMEINFO)
#ifdef HAVE_STRUCT_SOCKADDR_STORAGE
struct sockaddr_storage sa;
#else
return 4; /* Error, NI_WITHSCOPEID not defined or no getnameinfo() */
#endif
- ]) # AC_LANG_PROGRAM
+ ]]) # AC_LANG_PROGRAM
],[
# Exit code == 0. Program worked.
ac_cv_working_ni_withscopeid="yes"
# Program is not run when cross-compiling. So we assume
# NI_WITHSCOPEID will work if we are able to compile it.
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
- ],[
+ ]],[[
unsigned int dummy= NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID;
- ])
+ ]])
],[
ac_cv_working_ni_withscopeid="yes"
],[
#
AC_MSG_CHECKING([for recv])
AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#include <sys/socket.h>
#endif
#endif
- ],[
+ ]],[[
recv(0, 0, 0, 0);
- ])
+ ]])
],[
AC_MSG_RESULT([yes])
curl_cv_recv="yes"
for recv_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do
for recv_arg4 in 'int' 'unsigned int'; do
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#define RECVCALLCONV
#endif
extern $recv_retv RECVCALLCONV recv($recv_arg1, $recv_arg2, $recv_arg3, $recv_arg4);
- ],[
+ ]],[[
$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"
break 5
#
AC_MSG_CHECKING([for send])
AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#include <sys/socket.h>
#endif
#endif
- ],[
+ ]],[[
send(0, 0, 0, 0);
- ])
+ ]])
],[
AC_MSG_RESULT([yes])
curl_cv_send="yes"
for send_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do
for send_arg4 in 'int' 'unsigned int'; do
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#define SENDCALLCONV
#endif
extern $send_retv SENDCALLCONV send($send_arg1, $send_arg2, $send_arg3, $send_arg4);
- ],[
+ ]],[[
$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"
break 5
AC_CHECK_HEADERS(sys/types.h sys/socket.h)
AC_CACHE_CHECK([for MSG_NOSIGNAL], [ac_cv_msg_nosignal], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#include <sys/socket.h>
#endif
#endif
- ],[
+ ]],[[
int flag=MSG_NOSIGNAL;
- ])
+ ]])
],[
ac_cv_msg_nosignal="yes"
],[
AC_CHECK_HEADERS(sys/types.h sys/time.h time.h)
AC_CACHE_CHECK([for struct timeval], [ac_cv_struct_timeval], [
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#include <time.h>
#endif
#endif
- ],[
+ ]],[[
struct timeval ts;
ts.tv_sec = 0;
ts.tv_usec = 0;
- ])
+ ]])
],[
ac_cv_struct_timeval="yes"
],[
#
AC_MSG_CHECKING([if sig_atomic_t is already defined as volatile])
AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
- ],[
+ ]],[[
static volatile sig_atomic_t dummy = 0;
- ])
+ ]])
],[
AC_MSG_RESULT([no])
ac_cv_sig_atomic_t_volatile="no"
curl_cv_in_addr_t_equiv=
for t in "unsigned long" int size_t unsigned long; do
AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#include <arpa/inet.h>
#endif
#endif
- ],[
+ ]],[[
$t data = inet_addr ("1.2.3.4");
- ])
+ ]])
],[
curl_cv_in_addr_t_equiv="$t"
break
AC_CHECK_HEADERS(sys/types.h sys/time.h time.h)
AC_MSG_CHECKING([for monotonic clock_gettime])
AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <time.h>
#endif
#endif
- ],[
+ ]],[[
struct timespec ts;
(void)clock_gettime(CLOCK_MONOTONIC, &ts);
- ])
+ ]])
],[
AC_MSG_RESULT([yes])
ac_cv_func_clock_gettime="yes"
LIBS="$x_xlibs $curl_cv_save_LIBS"
fi
AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <time.h>
#endif
#endif
- ],[
+ ]],[[
struct timespec ts;
(void)clock_gettime(CLOCK_MONOTONIC, &ts);
- ])
+ ]])
],[
curl_cv_gclk_LIBS="$x_xlibs"
break
ac_func_getservbyport_r="unknown"
AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#include <netdb.h>
- ],[
+ ]],[[
int p1, p5;
char *p2, p4[4096];
struct servent *p3, *p6;
getservbyport_r(p1, p2, p3, p4, p5, &p6);
- ])
+ ]])
],[
ac_func_getservbyport_r="6"
])
if test "$ac_func_getservbyport_r" = "unknown"; then
AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#include <netdb.h>
- ],[
+ ]],[[
int p1, p5;
char *p2, p4[4096];
struct servent *p3;
getservbyport_r(p1, p2, p3, p4, p5);
- ])
+ ]])
],[
ac_func_getservbyport_r="5"
])
if test "$ac_func_getservbyport_r" = "unknown"; then
AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
+ AC_LANG_PROGRAM([[
#include <netdb.h>
- ],[
+ ]],[[
int p1;
char *p2;
struct servent *p3;
struct servent_data p4;
getservbyport_r(p1, p2, p3, &p4);
- ])
+ ]])
],[
ac_func_getservbyport_r="4"
])