18
18
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
# KIND, either express or implied.
21
# $Id: acinclude.m4,v 1.154 2008-05-21 18:24:09 yangtse Exp $
22
###########################################################################
21
# $Id: acinclude.m4,v 1.217 2009-01-11 23:41:50 bagder Exp $
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)
25
149
dnl CURL_CHECK_HEADER_WINDOWS
1483
1619
AC_MSG_ERROR([Unable to link function send])
1624
dnl CURL_CHECK_FUNC_RECVFROM
1625
dnl -------------------------------------------------
1626
dnl Test if the socket recvfrom() function is available,
1627
dnl and check its return type and the types of its
1628
dnl arguments. If the function succeeds HAVE_RECVFROM
1629
dnl will be defined, defining the types of the arguments
1630
dnl in RECVFROM_TYPE_ARG1, RECVFROM_TYPE_ARG2, and so on
1631
dnl to RECVFROM_TYPE_ARG6, defining also the type of the
1632
dnl function return value in RECVFROM_TYPE_RETV.
1633
dnl Notice that the types returned for pointer arguments
1634
dnl will actually be the type pointed by the pointer.
1636
AC_DEFUN([CURL_CHECK_FUNC_RECVFROM], [
1637
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl
1638
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
1639
AC_CHECK_HEADERS(sys/types.h sys/socket.h)
1641
AC_MSG_CHECKING([for recvfrom])
1645
#ifdef HAVE_WINDOWS_H
1646
#ifndef WIN32_LEAN_AND_MEAN
1647
#define WIN32_LEAN_AND_MEAN
1649
#include <windows.h>
1650
#ifdef HAVE_WINSOCK2_H
1651
#include <winsock2.h>
1653
#ifdef HAVE_WINSOCK_H
1654
#include <winsock.h>
1658
#ifdef HAVE_SYS_TYPES_H
1659
#include <sys/types.h>
1661
#ifdef HAVE_SYS_SOCKET_H
1662
#include <sys/socket.h>
1666
recvfrom(0, 0, 0, 0, 0, 0);
1669
AC_MSG_RESULT([yes])
1670
curl_cv_recvfrom="yes"
1673
curl_cv_recvfrom="no"
1676
if test "$curl_cv_recvfrom" = "yes"; then
1677
AC_CACHE_CHECK([types of args and return type for recvfrom],
1678
[curl_cv_func_recvfrom_args], [
1679
curl_cv_func_recvfrom_args="unknown"
1680
for recvfrom_retv in 'int' 'ssize_t'; do
1681
for recvfrom_arg1 in 'int' 'ssize_t' 'SOCKET'; do
1682
for recvfrom_arg2 in 'char *' 'void *'; do
1683
for recvfrom_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do
1684
for recvfrom_arg4 in 'int' 'unsigned int'; do
1685
for recvfrom_arg5 in 'struct sockaddr *' 'void *'; do
1686
for recvfrom_arg6 in 'socklen_t *' 'int *' 'unsigned int *' 'size_t *' 'void *'; do
1687
if test "$curl_cv_func_recvfrom_args" = "unknown"; then
1691
#ifdef HAVE_WINDOWS_H
1692
#ifndef WIN32_LEAN_AND_MEAN
1693
#define WIN32_LEAN_AND_MEAN
1695
#include <windows.h>
1696
#ifdef HAVE_WINSOCK2_H
1697
#include <winsock2.h>
1699
#ifdef HAVE_WINSOCK_H
1700
#include <winsock.h>
1703
#define RECVFROMCALLCONV PASCAL
1705
#ifdef HAVE_SYS_TYPES_H
1706
#include <sys/types.h>
1708
#ifdef HAVE_SYS_SOCKET_H
1709
#include <sys/socket.h>
1711
#define RECVFROMCALLCONV
1713
extern $recvfrom_retv RECVFROMCALLCONV
1714
recvfrom($recvfrom_arg1, $recvfrom_arg2,
1715
$recvfrom_arg3, $recvfrom_arg4,
1716
$recvfrom_arg5, $recvfrom_arg6);
1719
$recvfrom_arg2 buf=0;
1720
$recvfrom_arg3 len=0;
1721
$recvfrom_arg4 flags=0;
1722
$recvfrom_arg5 addr=0;
1723
$recvfrom_arg6 addrlen=0;
1724
$recvfrom_retv res=0;
1725
res = recvfrom(s, buf, len, flags, addr, addrlen);
1728
curl_cv_func_recvfrom_args="$recvfrom_arg1,$recvfrom_arg2,$recvfrom_arg3,$recvfrom_arg4,$recvfrom_arg5,$recvfrom_arg6,$recvfrom_retv"
1739
# Nearly last minute change for this release starts here
1740
AC_DEFINE_UNQUOTED(HAVE_RECVFROM, 1,
1741
[Define to 1 if you have the recvfrom function.])
1742
ac_cv_func_recvfrom="yes"
1743
# Nearly last minute change for this release ends here
1744
if test "$curl_cv_func_recvfrom_args" = "unknown"; then
1745
AC_MSG_WARN([Cannot find proper types to use for recvfrom args])
1747
recvfrom_prev_IFS=$IFS; IFS=','
1748
set dummy `echo "$curl_cv_func_recvfrom_args" | sed 's/\*/\*/g'`
1749
IFS=$recvfrom_prev_IFS
1752
recvfrom_ptrt_arg2=$[2]
1753
recvfrom_ptrt_arg5=$[5]
1754
recvfrom_ptrt_arg6=$[6]
1756
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG1, $[1],
1757
[Define to the type of arg 1 for recvfrom.])
1758
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG3, $[3],
1759
[Define to the type of arg 3 for recvfrom.])
1760
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG4, $[4],
1761
[Define to the type of arg 4 for recvfrom.])
1762
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_RETV, $[7],
1763
[Define to the function return type for recvfrom.])
1767
case $prev_sh_opts in
1775
recvfrom_type_arg2=`echo $recvfrom_ptrt_arg2 | sed 's/ \*//'`
1776
recvfrom_type_arg5=`echo $recvfrom_ptrt_arg5 | sed 's/ \*//'`
1777
recvfrom_type_arg6=`echo $recvfrom_ptrt_arg6 | sed 's/ \*//'`
1779
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG2, $recvfrom_type_arg2,
1780
[Define to the type pointed by arg 2 for recvfrom.])
1781
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG5, $recvfrom_type_arg5,
1782
[Define to the type pointed by arg 5 for recvfrom.])
1783
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG6, $recvfrom_type_arg6,
1784
[Define to the type pointed by arg 6 for recvfrom.])
1786
if test "$recvfrom_type_arg2" = "void"; then
1787
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG2_IS_VOID, 1,
1788
[Define to 1 if the type pointed by arg 2 for recvfrom is void.])
1790
if test "$recvfrom_type_arg5" = "void"; then
1791
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG5_IS_VOID, 1,
1792
[Define to 1 if the type pointed by arg 5 for recvfrom is void.])
1794
if test "$recvfrom_type_arg6" = "void"; then
1795
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG6_IS_VOID, 1,
1796
[Define to 1 if the type pointed by arg 6 for recvfrom is void.])
1799
case $prev_sh_opts in
1807
AC_DEFINE_UNQUOTED(HAVE_RECVFROM, 1,
1808
[Define to 1 if you have the recvfrom function.])
1809
ac_cv_func_recvfrom="yes"
1812
AC_MSG_WARN([Unable to link function recvfrom])
1488
1817
dnl CURL_CHECK_MSG_NOSIGNAL
1639
dnl CURL_CHECK_NONBLOCKING_SOCKET
1640
dnl -------------------------------------------------
1641
dnl Check for how to set a socket to non-blocking state. There seems to exist
1642
dnl four known different ways, with the one used almost everywhere being POSIX
1643
dnl and XPG3, while the other different ways for different systems (old BSD,
1644
dnl Windows and Amiga).
1646
dnl There are two known platforms (AIX 3.x and SunOS 4.1.x) where the
1647
dnl O_NONBLOCK define is found but does not work. This condition is attempted
1648
dnl to get caught in this script by using an excessive number of #ifdefs...
1650
AC_DEFUN([CURL_CHECK_NONBLOCKING_SOCKET], [
1651
AC_MSG_CHECKING([non-blocking sockets style])
1656
/* headers for O_NONBLOCK test */
1657
#include <sys/types.h>
1661
#if defined(sun) || defined(__sun__) || \
1662
defined(__SUNPRO_C) || defined(__SUNPRO_CC)
1663
# if defined(__SVR4) || defined(__srv4__)
1664
# define PLATFORM_SOLARIS
1666
# define PLATFORM_SUNOS4
1669
#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41)
1670
# define PLATFORM_AIX_V3
1673
#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3) || defined(__BEOS__)
1674
#error "O_NONBLOCK does not work on this platform"
1677
/* O_NONBLOCK source test */
1679
int flags = fcntl(socket, F_SETFL, flags | O_NONBLOCK);
1682
dnl the O_NONBLOCK test was fine
1683
nonblock="O_NONBLOCK"
1684
AC_DEFINE(HAVE_O_NONBLOCK, 1,
1685
[use O_NONBLOCK for non-blocking sockets])
1688
if test "$nonblock" = "unknown"; then
1691
/* headers for FIONBIO test */
1693
#include <stropts.h>
1695
/* FIONBIO source test (old-style unix) */
1697
int flags = ioctl(socket, FIONBIO, &flags);
1700
dnl FIONBIO test was good
1702
AC_DEFINE(HAVE_FIONBIO, 1,
1703
[use FIONBIO for non-blocking sockets])
1707
if test "$nonblock" = "unknown"; then
1710
/* headers for ioctlsocket test (Windows) */
1712
#ifdef HAVE_WINDOWS_H
1713
#ifndef WIN32_LEAN_AND_MEAN
1714
#define WIN32_LEAN_AND_MEAN
1716
#include <windows.h>
1717
#ifdef HAVE_WINSOCK2_H
1718
#include <winsock2.h>
1720
#ifdef HAVE_WINSOCK_H
1721
#include <winsock.h>
1726
/* ioctlsocket source code (Windows) */
1728
unsigned long flags = 0;
1729
sd = socket(0, 0, 0);
1730
ioctlsocket(sd, FIONBIO, &flags);
1733
dnl ioctlsocket test was good
1734
nonblock="ioctlsocket"
1735
AC_DEFINE(HAVE_IOCTLSOCKET, 1,
1736
[use ioctlsocket() for non-blocking sockets])
1740
if test "$nonblock" = "unknown"; then
1743
/* headers for IoctlSocket test (Amiga?) */
1744
#include <sys/ioctl.h>
1746
/* IoctlSocket source code (Amiga?) */
1748
int flags = IoctlSocket(socket, FIONBIO, (long)1);
1751
dnl Ioctlsocket test was good
1752
nonblock="IoctlSocket"
1753
AC_DEFINE(HAVE_IOCTLSOCKET_CASE, 1,
1754
[use Ioctlsocket() for non-blocking sockets])
1758
if test "$nonblock" = "unknown"; then
1761
/* headers for SO_NONBLOCK test (BeOS) */
1764
/* SO_NONBLOCK source code (BeOS) */
1767
int flags = setsockopt(socket, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b));
1770
dnl the SO_NONBLOCK test was good
1771
nonblock="SO_NONBLOCK"
1772
AC_DEFINE(HAVE_SO_NONBLOCK, 1,
1773
[use SO_NONBLOCK for non-blocking sockets])
1777
AC_MSG_RESULT($nonblock)
1779
if test "$nonblock" = "unknown"; then
1780
AC_DEFINE(HAVE_DISABLED_NONBLOCKING, 1,
1781
[disabled non-blocking sockets])
1782
AC_MSG_WARN([non-block sockets disabled])
2187
2414
ac_cv_func_select="yes"
2193
dnl ************************************************************
2194
dnl check for "localhost", if it doesn't exist, we can't do the
2195
dnl gethostbyname_r tests!
2198
AC_DEFUN([CURL_CHECK_WORKING_RESOLVER],[
2199
AC_MSG_CHECKING([if "localhost" resolves])
2202
#include <sys/types.h>
2205
#define NULL (void *)0
2211
h = gethostbyname("localhost");
2212
exit (h == NULL ? 1 : 0); }],[
2213
AC_MSG_RESULT(yes)],[
2215
AC_MSG_ERROR([can't figure out gethostbyname_r() since localhost doesn't resolve])
2221
dnl ************************************************************
2222
dnl check for working getaddrinfo() that works with AI_NUMERICHOST
2224
AC_DEFUN([CURL_CHECK_WORKING_GETADDRINFO],[
2225
AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,[
2228
#include <sys/types.h>
2229
#include <sys/socket.h>
2233
struct addrinfo hints, *ai;
2236
memset(&hints, 0, sizeof(hints));
2237
hints.ai_flags = AI_NUMERICHOST;
2238
hints.ai_family = AF_UNSPEC;
2239
hints.ai_socktype = SOCK_STREAM;
2240
error = getaddrinfo("127.0.0.1", "8080", &hints, &ai);
2247
ac_cv_working_getaddrinfo="yes"
2249
ac_cv_working_getaddrinfo="no"
2251
ac_cv_working_getaddrinfo="yes"
2253
if test "$ac_cv_working_getaddrinfo" = "yes"; then
2254
AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if getaddrinfo exists and works])
2255
AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
2258
AC_SUBST(IPV6_ENABLED)
2263
AC_DEFUN([CURL_CHECK_LOCALTIME_R],
2265
dnl check for localtime_r
2266
AC_CHECK_FUNCS(localtime_r,[
2267
AC_MSG_CHECKING(whether localtime_r is declared)
2268
AC_EGREP_CPP(localtime_r,[
2269
#include <time.h>],[
2270
AC_MSG_RESULT(yes)],[
2272
AC_MSG_CHECKING(whether localtime_r with -D_REENTRANT is declared)
2273
AC_EGREP_CPP(localtime_r,[
2275
#include <time.h>],[
2276
AC_DEFINE(NEED_REENTRANT)
2277
AC_MSG_RESULT(yes)],
2278
AC_MSG_RESULT(no))])])
2282
dnl This function checks for strerror_r(). If it isn't found at first, it
2283
dnl retries with _THREAD_SAFE defined, as that is what AIX seems to require
2284
dnl in order to find this function.
2286
dnl If the function is found, it will then proceed to check how the function
2287
dnl actually works: glibc-style or POSIX-style.
2290
dnl char *strerror_r(int errnum, char *buf, size_t n);
2292
dnl What this one does is to return the error string (no surprises there),
2293
dnl but it doesn't usually copy anything into buf! The 'buf' and 'n'
2294
dnl parameters are only meant as an optional working area, in case strerror_r
2295
dnl needs it. A quick test on a few systems shows that it's generally not
2299
dnl int strerror_r(int errnum, char *buf, size_t n);
2301
AC_DEFUN([CURL_CHECK_STRERROR_R],
2303
AC_CHECK_FUNCS(strerror_r)
2305
if test "x$ac_cv_func_strerror_r" = "xyes"; then
2307
AC_MSG_CHECKING(whether strerror_r is declared)
2308
AC_EGREP_CPP(strerror_r,[
2309
#include <string.h>],[
2310
AC_MSG_RESULT(yes)],[
2312
AC_MSG_CHECKING(whether strerror_r with -D_REENTRANT is declared)
2313
AC_EGREP_CPP(strerror_r,[
2315
#include <string.h>],[
2316
CPPFLAGS="-D_REENTRANT $CPPFLAGS"
2317
AC_MSG_RESULT(yes)],
2319
AC_DEFINE(HAVE_NO_STRERROR_R_DECL, 1, [we have no strerror_r() proto])
2320
) dnl with _THREAD_SAFE
2321
]) dnl plain cpp for it
2323
dnl determine if this strerror_r() is glibc or POSIX
2324
AC_MSG_CHECKING([for a glibc strerror_r API])
2330
char buffer[1024]; /* big enough to play with */
2332
strerror_r(EACCES, buffer, sizeof(buffer));
2333
/* this should've returned a string */
2334
if(!string || !string[0])
2339
GLIBC_STRERROR_R="1"
2340
AC_DEFINE(HAVE_GLIBC_STRERROR_R, 1, [we have a glibc-style strerror_r()])
2341
AC_MSG_RESULT([yes]),
2342
AC_MSG_RESULT([no]),
2344
dnl Use an inferior method of strerror_r detection while cross-compiling
2346
#include <features.h>
2351
dnl looks like glibc, so assume a glibc-style strerror_r()
2352
GLIBC_STRERROR_R="1"
2353
AC_DEFINE(HAVE_GLIBC_STRERROR_R, 1, [we have a glibc-style strerror_r()])
2354
AC_MSG_RESULT([yes]),
2355
AC_MSG_NOTICE([cannot determine strerror_r() style: edit lib/config.h manually!])
2356
) dnl while cross-compiling
2359
if test -z "$GLIBC_STRERROR_R"; then
2361
AC_MSG_CHECKING([for a POSIX strerror_r API])
2367
char buffer[1024]; /* big enough to play with */
2369
strerror_r(EACCES, buffer, sizeof(buffer));
2370
/* This should've returned zero, and written an error string in the
2372
if(!buffer[0] || error)
2377
AC_DEFINE(HAVE_POSIX_STRERROR_R, 1, [we have a POSIX-style strerror_r()])
2378
AC_MSG_RESULT([yes]),
2379
AC_MSG_RESULT([no]) ,
2380
dnl cross-compiling!
2381
AC_MSG_NOTICE([cannot determine strerror_r() style: edit lib/config.h manually!])
2384
fi dnl if not using glibc API
2386
fi dnl we have a strerror_r
2390
AC_DEFUN([CURL_CHECK_INET_NTOA_R],
2392
dnl determine if function definition for inet_ntoa_r exists.
2393
AC_CHECK_FUNCS(inet_ntoa_r,[
2394
AC_MSG_CHECKING(whether inet_ntoa_r is declared)
2395
AC_EGREP_CPP(inet_ntoa_r,[
2396
#include <arpa/inet.h>],[
2397
AC_DEFINE(HAVE_INET_NTOA_R_DECL, 1, [inet_ntoa_r() is declared])
2398
AC_MSG_RESULT(yes)],[
2400
AC_MSG_CHECKING(whether inet_ntoa_r with -D_REENTRANT is declared)
2401
AC_EGREP_CPP(inet_ntoa_r,[
2403
#include <arpa/inet.h>],[
2404
AC_DEFINE(HAVE_INET_NTOA_R_DECL, 1, [inet_ntoa_r() is declared])
2405
AC_DEFINE(NEED_REENTRANT, 1, [need REENTRANT defined])
2406
AC_MSG_RESULT(yes)],
2407
AC_MSG_RESULT(no))])])
2411
dnl CURL_CHECK_GETHOSTBYADDR_R
2412
dnl -------------------------------------------------
2413
dnl check number of arguments for gethostbyaddr_r, it
2414
dnl might take either 5, 7, or 8 arguments.
2416
AC_DEFUN([CURL_CHECK_GETHOSTBYADDR_R], [
2418
AC_MSG_CHECKING([for gethostbyaddr_r])
2420
AC_LANG_FUNC_LINK_TRY([gethostbyaddr_r])
2422
AC_MSG_RESULT([yes])
2423
tmp_cv_gethostbyaddr_r="yes"
2426
tmp_cv_gethostbyaddr_r="no"
2429
if test "$tmp_cv_gethostbyaddr_r" != "yes"; then
2430
AC_MSG_CHECKING([deeper for gethostbyaddr_r])
2437
AC_MSG_RESULT([yes])
2438
tmp_cv_gethostbyaddr_r="yes"
2440
AC_MSG_RESULT([but still no])
2441
tmp_cv_gethostbyaddr_r="no"
2445
if test "$tmp_cv_gethostbyaddr_r" = "yes"; then
2447
ac_cv_gethostbyaddr_r_args="unknown"
2449
AC_MSG_CHECKING([if gethostbyaddr_r takes 5 arguments])
2452
#include <sys/types.h>
2459
struct hostent_data hdata;
2461
rc = gethostbyaddr_r(address, length, type, &h, &hdata);
2464
AC_MSG_RESULT([yes])
2465
AC_DEFINE(HAVE_GETHOSTBYADDR_R_5, 1, [gethostbyaddr_r() takes 5 args])
2466
ac_cv_gethostbyaddr_r_args="5"
2471
if test "$ac_cv_gethostbyaddr_r_args" = "unknown"; then
2472
AC_MSG_CHECKING([if gethostbyaddr_r with -D_REENTRANT takes 5 arguments])
2476
#include <sys/types.h>
2483
struct hostent_data hdata;
2485
rc = gethostbyaddr_r(address, length, type, &h, &hdata);
2488
AC_MSG_RESULT([yes])
2489
AC_DEFINE(HAVE_GETHOSTBYADDR_R_5, 1, [gethostbyaddr_r() takes 5 args])
2490
AC_DEFINE(NEED_REENTRANT, 1, [need REENTRANT])
2491
ac_cv_gethostbyaddr_r_args="5"
2497
if test "$ac_cv_gethostbyaddr_r_args" = "unknown"; then
2498
AC_MSG_CHECKING([if gethostbyaddr_r takes 7 arguments])
2501
#include <sys/types.h>
2510
struct hostent * hp;
2511
hp = gethostbyaddr_r(address, length, type, &h,
2512
buffer, 8192, &h_errnop);
2515
AC_MSG_RESULT([yes])
2516
AC_DEFINE(HAVE_GETHOSTBYADDR_R_7, 1, [gethostbyaddr_r() takes 7 args])
2517
ac_cv_gethostbyaddr_r_args="7"
2523
if test "$ac_cv_gethostbyaddr_r_args" = "unknown"; then
2524
AC_MSG_CHECKING([if gethostbyaddr_r takes 8 arguments])
2527
#include <sys/types.h>
2536
struct hostent * hp;
2538
rc = gethostbyaddr_r(address, length, type, &h,
2539
buffer, 8192, &hp, &h_errnop);
2542
AC_MSG_RESULT([yes])
2543
AC_DEFINE(HAVE_GETHOSTBYADDR_R_8, 1, [gethostbyaddr_r() takes 8 args])
2544
ac_cv_gethostbyaddr_r_args="8"
2550
if test "$ac_cv_gethostbyaddr_r_args" = "unknown"; then
2551
AC_MSG_WARN([Cannot find out how to use gethostbyaddr_r])
2552
AC_MSG_WARN([HAVE_GETHOSTBYADDR_R will not be defined])
2553
ac_cv_func_gethostbyaddr_r="no"
2555
AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYADDR_R, 1,
2556
[Define to 1 if you have the gethostbyaddr_r function.])
2557
ac_cv_func_gethostbyaddr_r="yes"
2561
ac_cv_func_gethostbyaddr_r="no"
2566
dnl CURL_CHECK_GETHOSTBYNAME_R
2567
dnl -------------------------------------------------
2568
dnl check number of arguments for gethostbyname_r, it
2569
dnl might take either 3, 5, or 6 arguments.
2571
AC_DEFUN([CURL_CHECK_GETHOSTBYNAME_R], [
2573
AC_MSG_CHECKING([for gethostbyname_r])
2575
AC_LANG_FUNC_LINK_TRY([gethostbyname_r])
2577
AC_MSG_RESULT([yes])
2578
tmp_cv_gethostbyname_r="yes"
2581
tmp_cv_gethostbyname_r="no"
2584
if test "$tmp_cv_gethostbyname_r" != "yes"; then
2585
AC_MSG_CHECKING([deeper for gethostbyname_r])
2592
AC_MSG_RESULT([yes])
2593
tmp_cv_gethostbyname_r="yes"
2595
AC_MSG_RESULT([but still no])
2596
tmp_cv_gethostbyname_r="no"
2600
if test "$tmp_cv_gethostbyname_r" = "yes"; then
2602
ac_cv_gethostbyname_r_args="unknown"
2604
AC_MSG_CHECKING([if gethostbyname_r takes 3 arguments])
2608
#include <sys/types.h>
2611
#define NULL (void *)0
2613
gethostbyname_r(const char *, struct hostent *,
2614
struct hostent_data *);
2616
struct hostent_data data;
2617
gethostbyname_r(NULL, NULL, NULL);
2620
AC_MSG_RESULT([yes])
2621
AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1, [gethostbyname_r() takes 3 args])
2622
ac_cv_gethostbyname_r_args="3"
2627
if test "$ac_cv_gethostbyname_r_args" = "unknown"; then
2628
AC_MSG_CHECKING([if gethostbyname_r with -D_REENTRANT takes 3 arguments])
2633
#include <sys/types.h>
2636
#define NULL (void *)0
2638
gethostbyname_r(const char *, struct hostent *,
2639
struct hostent_data *);
2641
struct hostent_data data;
2642
gethostbyname_r(NULL, NULL, NULL);
2645
AC_MSG_RESULT([yes])
2646
AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1, [gethostbyname_r() takes 3 args])
2647
AC_DEFINE(NEED_REENTRANT, 1, [need REENTRANT])
2648
ac_cv_gethostbyname_r_args="3"
2654
if test "$ac_cv_gethostbyname_r_args" = "unknown"; then
2655
AC_MSG_CHECKING([if gethostbyname_r takes 5 arguments])
2658
#include <sys/types.h>
2661
#define NULL (void *)0
2663
gethostbyname_r(const char *, struct hostent *,
2664
char *, int, int *);
2666
gethostbyname_r(NULL, NULL, NULL, 0, NULL);
2669
AC_MSG_RESULT([yes])
2670
AC_DEFINE(HAVE_GETHOSTBYNAME_R_5, 1, [gethostbyname_r() takes 5 args])
2671
ac_cv_gethostbyname_r_args="5"
2677
if test "$ac_cv_gethostbyname_r_args" = "unknown"; then
2678
AC_MSG_CHECKING([if gethostbyname_r takes 6 arguments])
2681
#include <sys/types.h>
2684
#define NULL (void *)0
2686
gethostbyname_r(const char *, struct hostent *,
2687
char *, size_t, struct hostent **, int *);
2689
gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL);
2692
AC_MSG_RESULT([yes])
2693
AC_DEFINE(HAVE_GETHOSTBYNAME_R_6, 1, [gethostbyname_r() takes 6 args])
2694
ac_cv_gethostbyname_r_args="6"
2700
if test "$ac_cv_gethostbyname_r_args" = "unknown"; then
2701
AC_MSG_WARN([Cannot find out how to use gethostbyname_r])
2702
AC_MSG_WARN([HAVE_GETHOSTBYNAME_R will not be defined])
2703
ac_cv_func_gethostbyname_r="no"
2705
AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYNAME_R, 1,
2706
[Define to 1 if you have the gethostbyname_r function.])
2707
ac_cv_func_gethostbyname_r="yes"
2711
ac_cv_func_gethostbyname_r="no"
2716
dnl **********************************************************************
2717
dnl CURL_DETECT_ICC ([ACTION-IF-YES])
2719
dnl check if this is the Intel ICC compiler, and if so run the ACTION-IF-YES
2720
dnl sets the $ICC variable to "yes" or "no"
2721
dnl **********************************************************************
2722
AC_DEFUN([CURL_DETECT_ICC],
2725
AC_MSG_CHECKING([for icc in use])
2726
if test "$GCC" = "yes"; then
2727
dnl check if this is icc acting as gcc in disguise
2728
AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER],
2729
dnl action if the text is found, this it has not been replaced by the
2732
dnl the text was not found, it was replaced by the cpp
2734
AC_MSG_RESULT([yes])
2738
if test "$ICC" = "no"; then
2744
dnl We create a function for detecting which compiler we use and then set as
2745
dnl pendantic compiler options as possible for that particular compiler. The
2746
dnl options are only used for debug-builds.
2748
AC_DEFUN([CURL_CC_DEBUG_OPTS],
2750
if test "z$ICC" = "z"; then
2754
if test "$GCC" = "yes"; then
2756
dnl figure out gcc version!
2757
AC_MSG_CHECKING([gcc version])
2758
gccver=`$CC -dumpversion`
2759
num1=`echo $gccver | cut -d . -f1`
2760
num2=`echo $gccver | cut -d . -f2`
2761
gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
2762
AC_MSG_RESULT($gccver)
2764
if test "$ICC" = "yes"; then
2765
dnl this is icc, not gcc.
2767
dnl ICC warnings we ignore:
2768
dnl * 269 warns on our "%Od" printf formatters for curl_off_t output:
2769
dnl "invalid format string conversion"
2770
dnl * 279 warns on static conditions in while expressions
2771
dnl * 981 warns on "operands are evaluated in unspecified order"
2772
dnl * 1418 "external definition with no prior declaration"
2773
dnl * 1419 warns on "external declaration in primary source file"
2774
dnl which we know and do on purpose.
2776
WARN="-wd279,269,981,1418,1419"
2778
if test "$gccnum" -gt "600"; then
2779
dnl icc 6.0 and older doesn't have the -Wall flag
2783
dnl this is a set of options we believe *ALL* gcc versions support:
2784
WARN="-W -Wall -Wwrite-strings -pedantic -Wpointer-arith -Wnested-externs -Winline -Wmissing-prototypes"
2786
dnl -Wcast-align is a bit too annoying on all gcc versions ;-)
2788
if test "$gccnum" -ge "207"; then
2789
dnl gcc 2.7 or later
2790
WARN="$WARN -Wmissing-declarations"
2793
if test "$gccnum" -gt "295"; then
2794
dnl only if the compiler is newer than 2.95 since we got lots of
2795
dnl "`_POSIX_C_SOURCE' is not defined" in system headers with
2796
dnl gcc 2.95.4 on FreeBSD 4.9!
2797
WARN="$WARN -Wundef -Wno-long-long -Wsign-compare -Wshadow -Wno-multichar"
2800
if test "$gccnum" -ge "296"; then
2801
dnl gcc 2.96 or later
2802
WARN="$WARN -Wfloat-equal"
2805
if test "$gccnum" -gt "296"; then
2806
dnl this option does not exist in 2.96
2807
WARN="$WARN -Wno-format-nonliteral"
2810
dnl -Wunreachable-code seems totally unreliable on my gcc 3.3.2 on
2811
dnl on i686-Linux as it gives us heaps with false positives.
2812
dnl Also, on gcc 4.0.X it is totally unbearable and complains all
2813
dnl over making it unusable for generic purposes. Let's not use it.
2815
if test "$gccnum" -ge "303"; then
2816
dnl gcc 3.3 and later
2817
WARN="$WARN -Wendif-labels -Wstrict-prototypes"
2820
if test "$gccnum" -ge "304"; then
2821
# try these on gcc 3.4
2822
WARN="$WARN -Wdeclaration-after-statement"
2825
for flag in $CPPFLAGS; do
2828
dnl Include path, provide a -isystem option for the same dir
2829
dnl to prevent warnings in those dirs. The -isystem was not very
2830
dnl reliable on earlier gcc versions.
2831
add=`echo $flag | sed 's/^-I/-isystem /g'`
2839
CFLAGS="$CFLAGS $WARN"
2841
AC_MSG_NOTICE([Added this set of compiler options: $WARN])
2845
AC_MSG_NOTICE([Added no extra compiler options])
2849
dnl strip off optimizer flags
2851
for flag in $CFLAGS; do
2854
dnl echo "cut off $flag"
2857
NEWFLAGS="$NEWFLAGS $flag"
2863
]) dnl end of AC_DEFUN()
2865
2420
# This is only a temporary fix. This macro is here to replace the broken one
2866
2421
# delivered by the automake project (including the 1.9.6 release). As soon as
2643
dnl CURL_DEFINE_UNQUOTED (VARIABLE, [VALUE])
2644
dnl -------------------------------------------------
2645
dnl Like AC_DEFINE_UNQUOTED this macro will define a C preprocessor
2646
dnl symbol that can be further used in custom template configuration
2647
dnl files. This macro, unlike AC_DEFINE_UNQUOTED, does not use a third
2648
dnl argument for the description. Symbol definitions done with this
2649
dnl macro are intended to be exclusively used in handcrafted *.h.in
2650
dnl template files. Contrary to what AC_DEFINE_UNQUOTED does, this one
2651
dnl prevents autoheader generation and insertion of symbol template
2652
dnl stub and definition into the first configuration header file. Do
2653
dnl not use this macro as a replacement for AC_DEFINE_UNQUOTED, each
2654
dnl one serves different functional needs.
2656
AC_DEFUN([CURL_DEFINE_UNQUOTED], [
2657
cat >>confdefs.h <<_EOF
2658
[@%:@define] $1 ifelse($#, 2, [$2], 1)
2663
dnl CURL_INCLUDES_INTTYPES
2664
dnl -------------------------------------------------
2665
dnl Set up variable with list of headers that must be
2666
dnl included when inttypes.h is to be included.
2668
AC_DEFUN([CURL_INCLUDES_INTTYPES], [
2669
curl_includes_inttypes="\
2670
/* includes start */
2671
#ifdef HAVE_SYS_TYPES_H
2672
# include <sys/types.h>
2674
#ifdef HAVE_STDINT_H
2675
# include <stdint.h>
2677
#ifdef HAVE_INTTYPES_H
2678
# include <inttypes.h>
2682
sys/types.h stdint.h inttypes.h,
2683
[], [], [$curl_includes_inttypes])
2687
dnl CURL_CONFIGURE_LONG
2688
dnl -------------------------------------------------
2689
dnl Find out the size of long as reported by sizeof() and define
2690
dnl CURL_SIZEOF_LONG as appropriate to be used in template file
2691
dnl include/curl/curlbuild.h.in to properly configure the library.
2692
dnl The size of long is a build time characteristic and as such
2693
dnl must be recorded in curlbuild.h
2695
AC_DEFUN([CURL_CONFIGURE_LONG], [
2696
if test -z "$ac_cv_sizeof_long" ||
2697
test "$ac_cv_sizeof_long" -eq "0"; then
2698
AC_MSG_ERROR([cannot find out size of long.])
2700
CURL_DEFINE_UNQUOTED([CURL_SIZEOF_LONG], [$ac_cv_sizeof_long])
2704
dnl DO_CURL_OFF_T_CHECK (TYPE, SIZE)
2705
dnl -------------------------------------------------
2706
dnl Internal macro for CURL_CONFIGURE_CURL_OFF_T
2708
AC_DEFUN([DO_CURL_OFF_T_CHECK], [
2709
AC_REQUIRE([CURL_INCLUDES_INTTYPES])dnl
2710
if test "$curl_typeof_curl_off_t" = "unknown" && test ! -z "$1"; then
2714
case AS_TR_SH([$1]) in
2716
tmp_includes="$curl_includes_inttypes"
2717
tmp_source="char f@<:@@:>@ = PRId64;"
2721
tmp_includes="$curl_includes_inttypes"
2722
tmp_source="char f@<:@@:>@ = PRId32;"
2726
tmp_includes="$curl_includes_inttypes"
2727
tmp_source="char f@<:@@:>@ = PRId16;"
2734
typedef $1 curl_off_t;
2735
typedef char dummy_arr[sizeof(curl_off_t) == $2 ? 1 : -1];
2741
if test -z "$tmp_fmt"; then
2742
curl_typeof_curl_off_t="$1"
2743
curl_sizeof_curl_off_t="$2"
2745
CURL_CHECK_DEF([$tmp_fmt], [$curl_includes_inttypes], [silent])
2746
AS_VAR_PUSHDEF([tmp_HaveFmtDef], [curl_cv_have_def_$tmp_fmt])dnl
2747
AS_VAR_PUSHDEF([tmp_FmtDef], [curl_cv_def_$tmp_fmt])dnl
2748
if test AS_VAR_GET(tmp_HaveFmtDef) = "yes"; then
2749
curl_format_curl_off_t=AS_VAR_GET(tmp_FmtDef)
2750
curl_typeof_curl_off_t="$1"
2751
curl_sizeof_curl_off_t="$2"
2753
AS_VAR_POPDEF([tmp_FmtDef])dnl
2754
AS_VAR_POPDEF([tmp_HaveFmtDef])dnl
2761
dnl DO_CURL_OFF_T_SUFFIX_CHECK (TYPE)
2762
dnl -------------------------------------------------
2763
dnl Internal macro for CURL_CONFIGURE_CURL_OFF_T
2765
AC_DEFUN([DO_CURL_OFF_T_SUFFIX_CHECK], [
2766
AC_REQUIRE([CURL_INCLUDES_INTTYPES])dnl
2767
AC_MSG_CHECKING([constant suffix string for curl_off_t])
2769
curl_suffix_curl_off_t="unknown"
2770
curl_suffix_curl_off_tu="unknown"
2772
case AS_TR_SH([$1]) in
2773
long_long | __longlong | __longlong_t)
2783
tst_suffixes="LL:i64::"
2786
tst_suffixes="L:i32::"
2789
tst_suffixes="L:i16::"
2792
AC_MSG_ERROR([unexpected data type $1])
2796
old_IFS=$IFS; IFS=':'
2797
for tmp_ssuf in $tst_suffixes ; do
2799
if test "x$curl_suffix_curl_off_t" = "xunknown"; then
2802
tmp_usuf="u$tmp_ssuf"
2805
tmp_usuf="U$tmp_ssuf"
2813
$curl_includes_inttypes
2824
curl_suffix_curl_off_t="$tmp_ssuf"
2825
curl_suffix_curl_off_tu="$tmp_usuf"
2831
if test "x$curl_suffix_curl_off_t" = "xunknown"; then
2832
AC_MSG_ERROR([cannot find constant suffix string for curl_off_t.])
2834
AC_MSG_RESULT([$curl_suffix_curl_off_t])
2835
AC_MSG_CHECKING([constant suffix string for unsigned curl_off_t])
2836
AC_MSG_RESULT([$curl_suffix_curl_off_tu])
2842
dnl CURL_CONFIGURE_CURL_OFF_T
2843
dnl -------------------------------------------------
2844
dnl Find out suitable curl_off_t data type definition and associated
2845
dnl items, and make the appropriate definitions used in template file
2846
dnl include/curl/curlbuild.h.in to properly configure the library.
2848
AC_DEFUN([CURL_CONFIGURE_CURL_OFF_T], [
2849
AC_REQUIRE([CURL_INCLUDES_INTTYPES])dnl
2851
AC_BEFORE([$0],[AC_SYS_LARGEFILE])dnl
2852
AC_BEFORE([$0],[CURL_CONFIGURE_REENTRANT])dnl
2853
AC_BEFORE([$0],[CURL_CHECK_AIX_ALL_SOURCE])dnl
2855
if test -z "$SED"; then
2856
AC_MSG_ERROR([SED not set. Cannot continue without SED being set.])
2859
AC_CHECK_SIZEOF(long)
2860
AC_CHECK_SIZEOF(void*)
2862
if test -z "$ac_cv_sizeof_long" ||
2863
test "$ac_cv_sizeof_long" -eq "0"; then
2864
AC_MSG_ERROR([cannot find out size of long.])
2866
if test -z "$ac_cv_sizeof_voidp" ||
2867
test "$ac_cv_sizeof_voidp" -eq "0"; then
2868
AC_MSG_ERROR([cannot find out size of void*.])
2875
if test "$ac_cv_sizeof_long" -eq "8" &&
2876
test "$ac_cv_sizeof_voidp" -ge "8"; then
2878
elif test "$ac_cv_sizeof_long" -eq "4" &&
2879
test "$ac_cv_sizeof_voidp" -ge "4"; then
2881
elif test "$ac_cv_sizeof_long" -eq "2" &&
2882
test "$ac_cv_sizeof_voidp" -ge "2"; then
2886
dnl DO_CURL_OFF_T_CHECK results are stored in next 3 vars
2888
curl_typeof_curl_off_t="unknown"
2889
curl_sizeof_curl_off_t="unknown"
2890
curl_format_curl_off_t="unknown"
2891
curl_format_curl_off_tu="unknown"
2893
if test "$curl_typeof_curl_off_t" = "unknown"; then
2894
AC_MSG_CHECKING([for 64-bit curl_off_t data type])
2902
DO_CURL_OFF_T_CHECK([$t8], [8])
2904
AC_MSG_RESULT([$curl_typeof_curl_off_t])
2906
if test "$curl_typeof_curl_off_t" = "unknown"; then
2907
AC_MSG_CHECKING([for 32-bit curl_off_t data type])
2913
DO_CURL_OFF_T_CHECK([$t4], [4])
2915
AC_MSG_RESULT([$curl_typeof_curl_off_t])
2917
if test "$curl_typeof_curl_off_t" = "unknown"; then
2918
AC_MSG_CHECKING([for 16-bit curl_off_t data type])
2924
DO_CURL_OFF_T_CHECK([$t2], [2])
2926
AC_MSG_RESULT([$curl_typeof_curl_off_t])
2928
if test "$curl_typeof_curl_off_t" = "unknown"; then
2929
AC_MSG_ERROR([cannot find data type for curl_off_t.])
2932
AC_MSG_CHECKING([size of curl_off_t])
2933
AC_MSG_RESULT([$curl_sizeof_curl_off_t])
2935
AC_MSG_CHECKING([formatting string directive for curl_off_t])
2936
if test "$curl_format_curl_off_t" != "unknown"; then
2937
x_pull_headers="yes"
2938
curl_format_curl_off_t=`echo "$curl_format_curl_off_t" | "$SED" 's/[["]]//g'`
2939
curl_format_curl_off_tu=`echo "$curl_format_curl_off_t" | "$SED" 's/i$/u/'`
2940
curl_format_curl_off_tu=`echo "$curl_format_curl_off_tu" | "$SED" 's/d$/u/'`
2941
curl_format_curl_off_tu=`echo "$curl_format_curl_off_tu" | "$SED" 's/D$/U/'`
2944
case AS_TR_SH([$curl_typeof_curl_off_t]) in
2945
long_long | __longlong | __longlong_t)
2946
curl_format_curl_off_t="lld"
2947
curl_format_curl_off_tu="llu"
2950
curl_format_curl_off_t="ld"
2951
curl_format_curl_off_tu="lu"
2954
curl_format_curl_off_t="d"
2955
curl_format_curl_off_tu="u"
2958
curl_format_curl_off_t="I64d"
2959
curl_format_curl_off_tu="I64u"
2962
curl_format_curl_off_t="I32d"
2963
curl_format_curl_off_tu="I32u"
2966
curl_format_curl_off_t="I16d"
2967
curl_format_curl_off_tu="I16u"
2970
AC_MSG_ERROR([cannot find print format string for curl_off_t.])
2974
AC_MSG_RESULT(["$curl_format_curl_off_t"])
2976
AC_MSG_CHECKING([formatting string directive for unsigned curl_off_t])
2977
AC_MSG_RESULT(["$curl_format_curl_off_tu"])
2979
DO_CURL_OFF_T_SUFFIX_CHECK([$curl_typeof_curl_off_t])
2981
if test "$x_pull_headers" = "yes"; then
2982
if test "x$ac_cv_header_sys_types_h" = "xyes"; then
2983
CURL_DEFINE_UNQUOTED([CURL_PULL_SYS_TYPES_H])
2985
if test "x$ac_cv_header_stdint_h" = "xyes"; then
2986
CURL_DEFINE_UNQUOTED([CURL_PULL_STDINT_H])
2988
if test "x$ac_cv_header_inttypes_h" = "xyes"; then
2989
CURL_DEFINE_UNQUOTED([CURL_PULL_INTTYPES_H])
2993
CURL_DEFINE_UNQUOTED([CURL_TYPEOF_CURL_OFF_T], [$curl_typeof_curl_off_t])
2994
CURL_DEFINE_UNQUOTED([CURL_FORMAT_CURL_OFF_T], ["$curl_format_curl_off_t"])
2995
CURL_DEFINE_UNQUOTED([CURL_FORMAT_CURL_OFF_TU], ["$curl_format_curl_off_tu"])
2996
CURL_DEFINE_UNQUOTED([CURL_FORMAT_OFF_T], ["%$curl_format_curl_off_t"])
2997
CURL_DEFINE_UNQUOTED([CURL_SIZEOF_CURL_OFF_T], [$curl_sizeof_curl_off_t])
2998
CURL_DEFINE_UNQUOTED([CURL_SUFFIX_CURL_OFF_T], [$curl_suffix_curl_off_t])
2999
CURL_DEFINE_UNQUOTED([CURL_SUFFIX_CURL_OFF_TU], [$curl_suffix_curl_off_tu])
3004
dnl CURL_CHECK_WIN32_LARGEFILE
3005
dnl -------------------------------------------------
3006
dnl Check if curl's WIN32 large file will be used
3008
AC_DEFUN([CURL_CHECK_WIN32_LARGEFILE], [
3009
AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
3010
AC_MSG_CHECKING([whether build target supports WIN32 file API])
3011
curl_win32_file_api="no"
3012
if test "$ac_cv_header_windows_h" = "yes"; then
3013
if test x"$enable_largefile" != "xno"; then
3017
#if !defined(_WIN32_WCE) && \
3018
(defined(__MINGW32__) || \
3019
(defined(_MSC_VER) && (defined(_WIN32) || defined(_WIN64))))
3022
WIN32 large file API not supported.
3026
curl_win32_file_api="win32_large_files"
3029
if test "$curl_win32_file_api" = "no"; then
3033
#if defined(_WIN32_WCE) || defined(__MINGW32__) || defined(_MSC_VER)
3036
WIN32 small file API not supported.
3040
curl_win32_file_api="win32_small_files"
3044
case "$curl_win32_file_api" in
3046
AC_MSG_RESULT([yes (large file enabled)])
3047
AC_DEFINE_UNQUOTED(USE_WIN32_LARGE_FILES, 1,
3048
[Define to 1 if you are building a Windows target with large file support.])
3051
AC_MSG_RESULT([yes (large file disabled)])
3052
AC_DEFINE_UNQUOTED(USE_WIN32_LARGE_FILES, 1,
3053
[Define to 1 if you are building a Windows target without large file support.])
3061
dnl CURL_CHECK_PKGCONFIG ($module)
3062
dnl ------------------------
3063
dnl search for the pkg-config tool (if not cross-compiling). Set the PKGCONFIG
3064
dnl variable to hold the path to it, or 'no' if not found/present.
3066
dnl If pkg-config is present, check that it has info about the $module or return
3070
AC_DEFUN([CURL_CHECK_PKGCONFIG], [
3071
if test x$cross_compiling != xyes; then
3072
dnl only do pkg-config magic when not cross-compiling
3073
AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
3075
if test x$PKGCONFIG != xno; then
3076
AC_MSG_CHECKING([for $1 options with pkg-config])
3077
dnl ask pkg-config about $1
3078
$PKGCONFIG --exists $1
3079
if test "$?" -ne "0"; then
3080
dnl pkg-config does not have info about the given module! set the
3081
dnl variable to 'no'
3085
AC_MSG_RESULT([found])