18
18
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
# KIND, either express or implied.
21
# $Id: configure.ac,v 1.300 2008-05-26 15:09:28 bagder Exp $
22
###########################################################################
21
# $Id: configure.ac,v 1.392 2009-02-13 05:49:58 yangtse Exp $
22
#***************************************************************************
23
23
dnl Process this file with autoconf to produce a configure script.
27
27
dnl We don't know the version number "statically" so we use a dash here
28
28
AC_INIT([curl], [-], [a suitable curl mailing list => http://curl.haxx.se/mail/])
30
CURL_OVERRIDE_AUTOCONF
30
32
dnl configure script copyright
31
33
AC_COPYRIGHT([Copyright (c) 1998 - 2008 Daniel Stenberg, <daniel@haxx.se>
32
34
This configure script may be copied, distributed and modified under the
33
35
terms of the curl license; see COPYING for more details])
35
37
AC_CONFIG_SRCDIR([lib/urldata.h])
36
AM_CONFIG_HEADER(lib/config.h src/config.h)
38
AM_CONFIG_HEADER(lib/config.h src/config.h include/curl/curlbuild.h)
39
dnl SED is needed by some of the tools
40
AC_PATH_PROG( SED, sed, sed-was-not-found-by-configure,
41
$PATH:/usr/bin:/usr/local/bin)
44
if test "x$SED" = "xsed-was-not-found-by-configure"; then
45
AC_MSG_WARN([sed was not found, this may ruin your chances to build fine])
48
dnl AR is used by libtool, and try the odd Solaris path too
49
dnl we use AC_CHECK_TOOL since this should make a library for the target
52
ar-was-not-found-by-configure,
53
$PATH:/usr/bin:/usr/local/bin:/usr/ccs/bin)
55
if test "x$AR" = "xar-was-not-found-by-configure"; then
56
AC_MSG_WARN([ar was not found, this may ruin your chances to build fine])
41
CURL_CHECK_OPTION_DEBUG
42
CURL_CHECK_OPTION_OPTIMIZE
43
CURL_CHECK_OPTION_WARNINGS
45
CURL_CHECK_PATH_SEPARATOR
47
dnl SED is mandatory for configure process and libtool.
48
dnl Set it now, allowing it to be changed later.
49
AC_PATH_PROG([SED], [sed], [not_found],
50
[$PATH:/usr/bin:/usr/local/bin])
51
if test -z "$SED" || test "$SED" = "not_found"; then
52
AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
56
dnl GREP is mandatory for configure process and libtool.
57
dnl Set it now, allowing it to be changed later.
58
AC_PATH_PROG([GREP], [grep], [not_found],
59
[$PATH:/usr/bin:/usr/local/bin])
60
if test -z "$GREP" || test "$GREP" = "not_found"; then
61
AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
65
dnl EGREP is mandatory for configure process and libtool.
66
dnl Set it now, allowing it to be changed later.
67
if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
68
AC_MSG_CHECKING([for egrep])
70
AC_MSG_RESULT([$EGREP])
72
AC_PATH_PROG([EGREP], [egrep], [not_found],
73
[$PATH:/usr/bin:/usr/local/bin])
75
if test -z "$EGREP" || test "$EGREP" = "not_found"; then
76
AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
80
dnl AR is mandatory for configure process and libtool.
81
dnl This is target dependant, so check it as a tool.
82
AC_PATH_TOOL([AR], [ar], [not_found],
83
[$PATH:/usr/bin:/usr/local/bin])
84
if test -z "$AR" || test "$AR" = "not_found"; then
85
AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
60
91
dnl figure out the libcurl version
106
137
dnl Get system canonical name
107
138
AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
109
dnl Check for AIX weirdos
112
140
dnl Checks for programs.
143
dnl Our curl_off_t internal and external configure settings
144
CURL_CONFIGURE_CURL_OFF_T
146
dnl This defines _ALL_SOURCE for AIX
147
CURL_CHECK_AIX_ALL_SOURCE
149
dnl Our configure and build reentrant settings
150
CURL_CONFIGURE_REENTRANT
115
152
dnl check for how to do large files
118
155
dnl support building of Windows DLLs
119
156
AC_LIBTOOL_WIN32_DLL
121
dnl skip libtool C++ and Fortran compiler checks
122
m4_ifdef([AC_PROG_CXX], [m4_undefine([AC_PROG_CXX])])
123
m4_defun([AC_PROG_CXX],[])
124
m4_ifdef([AC_PROG_CXXCPP], [m4_undefine([AC_PROG_CXXCPP])])
125
m4_defun([AC_PROG_CXXCPP],[true])
126
m4_ifdef([AC_PROG_F77], [m4_undefine([AC_PROG_F77])])
127
m4_defun([AC_PROG_F77],[])
129
dnl skip libtool C++ and Fortran linker checks
130
m4_ifdef([AC_LIBTOOL_CXX], [m4_undefine([AC_LIBTOOL_CXX])])
131
m4_defun([AC_LIBTOOL_CXX],[])
132
m4_ifdef([AC_LIBTOOL_CXXCPP], [m4_undefine([AC_LIBTOOL_CXXCPP])])
133
m4_defun([AC_LIBTOOL_CXXCPP],[true])
134
m4_ifdef([AC_LIBTOOL_F77], [m4_undefine([AC_LIBTOOL_F77])])
135
m4_defun([AC_LIBTOOL_F77],[])
137
dnl force libtool to build static libraries with PIC on AMD64-linux
138
AC_MSG_CHECKING([if arch-OS host is AMD64-linux (to build static libraries with PIC)])
158
CURL_PROCESS_DEBUG_BUILD_OPTS
160
dnl force libtool to build static libraries with PIC on AMD64-Linux & FreeBSD
161
AC_MSG_CHECKING([if arch-OS host is AMD64-Linux/FreeBSD (to build static libraries with PIC)])
163
x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
141
164
AC_MSG_RESULT([yes])
215
238
dnl **********************************************************************
239
dnl platform/compiler/architecture specific checks/flags
240
dnl **********************************************************************
243
CURL_SET_COMPILER_BASIC_OPTS
244
CURL_SET_COMPILER_DEBUG_OPTS
245
CURL_SET_COMPILER_OPTIMIZE_OPTS
246
CURL_SET_COMPILER_WARNING_OPTS
250
x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
252
if test "$compiler_id" = "INTEL_UNIX_C"; then
254
if test "$compiler_num" -ge "900" &&
255
test "$compiler_num" -lt "1000"; then
257
CFLAGS="$CFLAGS -i-dynamic"
260
if test "$compiler_num" -ge "1000"; then
261
dnl icc 10.X or later
262
CFLAGS="$CFLAGS -shared-intel"
270
CURL_CHECK_COMPILER_HALT_ON_ERROR
271
CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
273
dnl **********************************************************************
274
dnl Compilation based checks should not be done before this point.
275
dnl **********************************************************************
277
dnl **********************************************************************
216
278
dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
217
279
dnl and ws2tcpip.h take precedence over any other further checks which
218
280
dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
237
299
ac_cv_header_winber_h="no"
241
dnl **********************************************************************
242
dnl platform/compiler/architecture specific checks/flags
243
dnl **********************************************************************
249
dnl find out if icc is being used
250
if test "z$ICC" = "z"; then
254
if test "$ICC" = "yes"; then
255
dnl figure out icc version
256
AC_MSG_CHECKING([icc version])
257
iccver=`$CC -dumpversion`
258
iccnhi=`echo $iccver | cut -d . -f1`
259
iccnlo=`echo $iccver | cut -d . -f2`
260
iccnum=`(expr $iccnhi "*" 100 + $iccnlo) 2>/dev/null`
261
AC_MSG_RESULT($iccver)
263
if test "$iccnum" -ge "900" && test "$iccnum" -lt "1000"; then
265
CFLAGS="$CFLAGS -i-dynamic"
268
if test "$iccnum" -ge "1000"; then
269
dnl icc 10.X or later
270
CFLAGS="$CFLAGS -shared-intel"
302
CURL_CHECK_WIN32_LARGEFILE
278
304
dnl ************************************************************
279
305
dnl switch off particular protocols
384
410
AC_SUBST(CURL_DISABLE_LDAPS, [1])
413
AC_MSG_CHECKING([whether to support proxies])
415
AC_HELP_STRING([--enable-proxy],[Enable proxy support])
416
AC_HELP_STRING([--disable-proxy],[Disable proxy support]),
417
[ case "$enableval" in
420
AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
421
AC_SUBST(CURL_DISABLE_PROXY, [1])
423
*) AC_MSG_RESULT(yes)
387
429
AC_MSG_CHECKING([whether to support dict])
388
430
AC_ARG_ENABLE(dict,
389
431
AC_HELP_STRING([--enable-dict],[Enable DICT support])
453
495
dnl script to allow other actions to disable it as well.
455
497
dnl **********************************************************************
456
dnl check if this is the Intel ICC compiler, and if so make it stricter
457
dnl (convert warning 147 into an error) so that it properly can detect the
458
dnl gethostbyname_r() version
459
dnl **********************************************************************
460
CURL_DETECT_ICC([CFLAGS="$CFLAGS -we 147"])
462
dnl **********************************************************************
463
498
dnl Checks for libraries.
464
499
dnl **********************************************************************
784
818
curl_ipv6_msg="enabled"
787
dnl **********************************************************************
788
dnl Check how non-blocking sockets are set
789
dnl **********************************************************************
790
AC_ARG_ENABLE(nonblocking,
791
AC_HELP_STRING([--enable-nonblocking],[Enable detecting how to do it])
792
AC_HELP_STRING([--disable-nonblocking],[Disable non-blocking socket detection]),
794
if test "$enableval" = "no" ; then
795
AC_MSG_WARN([non-blocking sockets disabled])
796
AC_DEFINE(HAVE_DISABLED_NONBLOCKING, 1,
797
[to disable NON-BLOCKING connections])
821
# Check if struct sockaddr_in6 have sin6_scope_id member
822
if test "$ipv6" = yes; then
823
AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
825
#include <sys/types.h>
826
#include <netinet/in.h>] ,
827
struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes)
828
if test "$have_sin6_scope_id" = yes; then
830
AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
799
CURL_CHECK_NONBLOCKING_SOCKET
803
CURL_CHECK_NONBLOCKING_SOCKET
806
836
dnl **********************************************************************
807
837
dnl Check if the operating system allows programs to write to their own argv[]
1045
1075
AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
1046
1076
dnl check if we have a really old MIT kerberos (<= 1.2)
1047
1077
AC_MSG_CHECKING([if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE])
1049
1080
#include <gssapi/gssapi.h>
1050
1081
#include <gssapi/gssapi_generic.h>
1051
1082
#include <gssapi/gssapi_krb5.h>
1053
1084
gss_import_name(
1054
1085
(OM_uint32 *)0,
1055
1086
(gss_buffer_t)0,
1056
1087
GSS_C_NT_HOSTBASED_SERVICE,
1057
1088
(gss_name_t *)0);
1059
AC_MSG_RESULT([yes])
1062
AC_DEFINE(HAVE_OLD_GSSMIT, 1, [if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE])
1091
AC_MSG_RESULT([yes])
1094
AC_DEFINE(HAVE_OLD_GSSMIT, 1,
1095
[if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE])
1141
1172
PREFIX_OPENSSL=$OPT_SSL
1142
1173
LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
1143
LDFLAGS="$LDFLAGS -L$LIB_OPENSSL"
1144
CPPFLAGS="$CPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
1174
if [ "$PREFIX_OPENSSL" != "/usr" ] ; then
1175
LDFLAGS="$LDFLAGS -L$LIB_OPENSSL"
1176
CPPFLAGS="$CPPFLAGS -I$PREFIX_OPENSSL/include"
1178
CPPFLAGS="$CPPFLAGS -I$PREFIX_OPENSSL/include/openssl"
1148
1182
if test "$PKGTEST" = "yes"; then
1150
dnl Detect the pkg-config tool, as it may have extra info about the
1151
dnl openssl installation we can use. I *believe* this is what we are
1152
dnl expected to do on really recent Redhat Linux hosts.
1184
CURL_CHECK_PKGCONFIG(openssl)
1154
AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
1155
1186
if test "$PKGCONFIG" != "no" ; then
1156
AC_MSG_CHECKING([OpenSSL options with pkg-config])
1158
$PKGCONFIG --exists openssl
1161
if test "$SSL_EXISTS" -eq "0"; then
1162
SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null`
1163
SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null`
1164
SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
1166
LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'`
1168
dnl use the values pkg-config reported
1169
LIBS="$LIBS $SSL_LIBS"
1170
CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
1171
LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
1172
AC_MSG_RESULT([found])
1187
SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null`
1188
SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null`
1189
SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
1191
LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'`
1193
dnl use the values pkg-config reported
1194
LIBS="$LIBS $SSL_LIBS"
1195
CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
1196
LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
1179
1200
dnl This is for Msys/Mingw
1182
dnl Under Cygwin this is extraneous and causes an unnecessary -lgdi32
1183
dnl to be added to LIBS and recorded in the .la file.
1202
*-*-msys* | *-*-mingw*)
1186
1203
AC_MSG_CHECKING([for gdi32])
1187
1204
my_ac_save_LIBS=$LIBS
1188
1205
LIBS="-lgdi32 $LIBS"
1531
1548
if test "$OPENSSL_ENABLED" != "1"; then
1533
1550
if test X"$OPT_GNUTLS" != Xno; then
1552
AC_MSG_NOTICE([OPT_GNUTLS is $OPT_GNUTLS])
1534
1555
if test "x$OPT_GNUTLS" = "xyes"; then
1535
check=`libgnutls-config --version 2>/dev/null`
1536
if test -n "$check"; then
1537
addlib=`libgnutls-config --libs`
1538
addcflags=`libgnutls-config --cflags`
1539
version=`libgnutls-config --version`
1540
gtlsprefix=`libgnutls-config --prefix`
1556
check=`libgnutls-config --version 2>/dev/null`
1557
if test -n "$check"; then
1558
addlib=`libgnutls-config --libs`
1559
addcflags=`libgnutls-config --cflags`
1560
version=`libgnutls-config --version`
1561
gtlslib=`libgnutls-config --prefix`/lib$libsuff
1543
1564
addlib=`$OPT_GNUTLS/bin/libgnutls-config --libs`
1544
1565
addcflags=`$OPT_GNUTLS/bin/libgnutls-config --cflags`
1545
1566
version=`$OPT_GNUTLS/bin/libgnutls-config --version 2>/dev/null`
1546
gtlsprefix=$OPT_GNUTLS
1547
if test -z "$version"; then
1567
gtlslib=$OPT_GNUTLS/lib$libsuff
1570
if test -z "$version"; then
1571
CURL_CHECK_PKGCONFIG(gnutls)
1573
if test "$PKGCONFIG" != "no" ; then
1574
addlib=`$PKGCONFIG --libs-only-l gnutls`
1575
addld=`$PKGCONFIG --libs-only-L gnutls`
1576
addcflags=`$PKGCONFIG --cflags-only-I gnutls`
1577
version=`$PKGCONFIG --modversion gnutls`
1578
gtlslib=`echo $addld | $SED -e 's/-L//'`
1583
if test -z "$version"; then
1584
dnl lots of efforts, still no go
1551
1588
if test -n "$addlib"; then
1553
1590
CLEANLIBS="$LIBS"
1554
1591
CLEANCPPFLAGS="$CPPFLAGS"
1592
CLEADLDFLAGS="$LDFLAGS"
1556
1594
LIBS="$LIBS $addlib"
1595
LDFLAGS="$LDFLAGS $addld"
1557
1596
if test "$addcflags" != "-I/usr/include"; then
1558
1597
CPPFLAGS="$CPPFLAGS $addcflags"
1574
1613
if test "x$USE_GNUTLS" = "xyes"; then
1575
1614
AC_MSG_NOTICE([detected GnuTLS version $version])
1577
dnl when shared libs were found in a path that the run-time
1578
dnl linker doesn't search through, we need to add it to
1579
dnl LD_LIBRARY_PATH to prevent further configure tests to fail
1616
if test -n "$gtlslib"; then
1617
dnl when shared libs were found in a path that the run-time
1618
dnl linker doesn't search through, we need to add it to
1619
dnl LD_LIBRARY_PATH to prevent further configure tests to fail
1582
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlsprefix/lib$libsuff"
1583
export LD_LIBRARY_PATH
1584
AC_MSG_NOTICE([Added $gtlsprefix/lib$libsuff to LD_LIBRARY_PATH])
1622
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlslib"
1623
export LD_LIBRARY_PATH
1624
AC_MSG_NOTICE([Added $gtlslib to LD_LIBRARY_PATH])
1607
1648
if test X"$OPT_NSS" != Xno; then
1608
1649
if test "x$OPT_NSS" = "xyes"; then
1609
check=`pkg-config --version 2>/dev/null`
1610
if test -n "$check"; then
1611
addlib=`pkg-config --libs nss`
1612
addcflags=`pkg-config --cflags nss`
1613
version=`pkg-config --modversion nss`
1614
nssprefix=`pkg-config --variable=prefix nss`
1651
CURL_CHECK_PKGCONFIG(nss)
1653
if test "$PKGCONFIG" != "no" ; then
1654
addlib=`$PKGCONFIG --libs nss`
1655
addcflags=`$PKGCONFIG --cflags nss`
1656
version=`$PKGCONFIG --modversion nss`
1657
nssprefix=`$PKGCONFIG --variable=prefix nss`
1617
1660
# Without pkg-config, we'll kludge in some defaults
1618
1661
addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl"
1773
1816
AC_DEFINE(DISABLED_THREADSAFE, 1,
1774
1817
[Set to explicitly specify we don't want to use thread-safe functions])
1776
if test "$ipv6" != "yes"; then
1819
dnl if test "$ipv6" != "yes"; then
1777
1820
dnl dig around for gethostbyname_r()
1778
CURL_CHECK_GETHOSTBYNAME_R()
1821
dnl the old gethostbyname_r check was done here
1780
1823
dnl dig around for gethostbyaddr_r()
1781
dnl CURL_CHECK_GETHOSTBYADDR_R()
1824
dnl the old gethostbyaddr_r check was here BUT COMMENTED OUT
1784
1827
dnl poke around for inet_ntoa_r()
1785
CURL_CHECK_INET_NTOA_R()
1828
dnl the old inet_ntoa_r check was done here
1787
1830
dnl is there a localtime_r()
1788
CURL_CHECK_LOCALTIME_R()
1831
dnl the old localtime_r check was done here
1790
1833
dnl is there a strerror_r()
1791
CURL_CHECK_STRERROR_R()
1834
dnl the old strerror_r check was done here
1793
1836
checkfor_gmtime_r="yes"
1806
1849
AC_DEFINE(_THREAD_SAFE, 1, [define this if you need it to compile thread-safe code])
1808
dnl check if this is the IMB xlc compiler
1809
dnl Details thanks to => http://predef.sourceforge.net/
1810
AC_MSG_CHECKING([if this is the xlc compiler])
1811
AC_EGREP_CPP([^__xlC__], [__xlC__],
1812
dnl action if the text is found, this it has not been replaced by the
1815
AC_MSG_RESULT([no]),
1816
dnl the text was not found, it was replaced by the cpp
1818
AC_MSG_RESULT([yes])
1819
CFLAGS="$CFLAGS -qthreaded"
1820
dnl AIX xlc has to have strict aliasing turned off. If not,
1821
dnl the optimizer assumes that pointers can only point to
1822
dnl an object of the same type.
1823
CFLAGS="$CFLAGS -qnoansialias"
1824
dnl Force AIX xlc to stop after the compilation phase, and not
1825
dnl generate object code, when the source compiles with errors.
1826
CFLAGS="$CFLAGS -qhalt=e"
1830
1851
dnl is there a localtime_r()
1831
CURL_CHECK_LOCALTIME_R()
1852
dnl the old localtime_r check was done here
1833
1854
dnl is there a strerror_r()
1834
CURL_CHECK_STRERROR_R()
1855
dnl the old strerror_r check was done here
1836
1857
checkfor_gmtime_r="yes"
1839
if test x$cross_compiling != xyes; then
1841
if test x$checkfor_gmtime_r = xyes; then
1843
dnl if gmtime_r was found, verify that it actually works, as (at least) HPUX
1844
dnl 10.20 is known to have a buggy one. If it doesn't work, disable use of
1847
AC_MSG_CHECKING([if gmtime_r exists and works])
1852
time_t local = 1170352587;
1855
putenv("TZ=CST6CDT");
1857
gmt = gmtime_r(&local, &keeper);
1861
return 1; /* failure */
1864
dnl success, do nothing
1866
AC_DEFINE(HAVE_GMTIME_R, 1, [if you have (a working) gmtime_r])
1868
dnl failure, now disable the function
1871
dnl not invoked when crosscompiling)
1876
dnl and for crosscompiling
1877
AC_CHECK_FUNCS(gmtime_r)
1881
1861
dnl **********************************************************************
1882
1862
dnl Back to "normal" configuring
1963
1944
CURL_CHECK_STRUCT_TIMEVAL
1964
1945
CURL_VERIFY_RUNTIMELIBS
1966
AC_CHECK_SIZEOF(curl_off_t, ,[
1968
#include "$srcdir/include/curl/curl.h"
1970
1947
AC_CHECK_SIZEOF(size_t)
1948
AC_CHECK_SIZEOF(int)
1971
1949
AC_CHECK_SIZEOF(long)
1972
1951
AC_CHECK_SIZEOF(time_t)
1973
1952
AC_CHECK_SIZEOF(off_t)
1955
if test x"$ac_cv_native_windows" != "xyes" &&
1956
test $ac_cv_sizeof_off_t -ne $curl_sizeof_curl_off_t; then
1957
AC_MSG_WARN([This libcurl built is probably not ABI compatible with previous])
1958
AC_MSG_WARN([builds! You MUST read lib/README.curl_off_t to figure it out.])
1975
1963
AC_CHECK_TYPE(long long,
1976
[AC_DEFINE(HAVE_LONGLONG, 1, [if your compiler supports long long])]
1964
[AC_DEFINE(HAVE_LONGLONG, 1,
1965
[Define to 1 if the compiler supports the 'long long' data type.])]
2018
2007
CURL_CHECK_FUNC_SELECT
2020
2009
CURL_CHECK_FUNC_RECV
2010
CURL_CHECK_FUNC_RECVFROM
2022
2011
CURL_CHECK_FUNC_SEND
2024
2012
CURL_CHECK_MSG_NOSIGNAL
2014
CURL_CHECK_FUNC_ALARM
2015
CURL_CHECK_FUNC_FCNTL
2016
CURL_CHECK_FUNC_FDOPEN
2017
CURL_CHECK_FUNC_FREEADDRINFO
2018
CURL_CHECK_FUNC_FREEIFADDRS
2019
CURL_CHECK_FUNC_FTRUNCATE
2020
CURL_CHECK_FUNC_GETADDRINFO
2021
CURL_CHECK_FUNC_GETHOSTBYADDR
2022
CURL_CHECK_FUNC_GETHOSTBYADDR_R
2023
CURL_CHECK_FUNC_GETHOSTBYNAME
2024
CURL_CHECK_FUNC_GETHOSTBYNAME_R
2025
CURL_CHECK_FUNC_GETHOSTNAME
2026
CURL_CHECK_FUNC_GETIFADDRS
2027
CURL_CHECK_FUNC_GETSERVBYPORT_R
2028
CURL_CHECK_FUNC_GMTIME_R
2029
CURL_CHECK_FUNC_INET_NTOA_R
2030
CURL_CHECK_FUNC_INET_NTOP
2031
CURL_CHECK_FUNC_INET_PTON
2032
CURL_CHECK_FUNC_IOCTL
2033
CURL_CHECK_FUNC_IOCTLSOCKET
2034
CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
2035
CURL_CHECK_FUNC_LOCALTIME_R
2036
CURL_CHECK_FUNC_POLL
2037
CURL_CHECK_FUNC_SETSOCKOPT
2038
CURL_CHECK_FUNC_SIGACTION
2039
CURL_CHECK_FUNC_SIGINTERRUPT
2040
CURL_CHECK_FUNC_SIGNAL
2041
CURL_CHECK_FUNC_SIGSETJMP
2042
CURL_CHECK_FUNC_STRCASECMP
2043
CURL_CHECK_FUNC_STRCASESTR
2044
CURL_CHECK_FUNC_STRCMPI
2045
CURL_CHECK_FUNC_STRDUP
2046
CURL_CHECK_FUNC_STRERROR_R
2047
CURL_CHECK_FUNC_STRICMP
2048
CURL_CHECK_FUNC_STRLCAT
2049
CURL_CHECK_FUNC_STRNCASECMP
2050
CURL_CHECK_FUNC_STRNCMPI
2051
CURL_CHECK_FUNC_STRNICMP
2052
CURL_CHECK_FUNC_STRSTR
2053
CURL_CHECK_FUNC_STRTOK_R
2054
CURL_CHECK_FUNC_STRTOLL
2055
CURL_CHECK_FUNC_WRITEV
2026
2057
dnl Checks for library functions.
2027
2058
dnl AC_PROG_GCC_TRADITIONAL
2034
2065
AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
2037
AC_CHECK_FUNCS( strtoll \
2076
dnl if not found, $ac_func is the name we check for
2078
eval skipcheck=\$skipcheck_$func
2079
if test "x$skipcheck" != "xyes"; then
2080
AC_MSG_CHECKING([deeper for $func])
2084
eval "ac_cv_func_$func=yes"
2085
def=`echo "HAVE_$func" | tr 'a-z' 'A-Z'`
2086
AC_DEFINE_UNQUOTED($def, 1, [If you have $func]),
2087
AC_MSG_RESULT(but still no)
2092
dnl sigsetjmp() might be a macro and no function so if it isn't found already
2093
dnl we make an extra check here!
2094
if test "$ac_cv_func_sigsetjmp" != "yes"; then
2095
AC_MSG_CHECKING([for sigsetjmp defined as macro])
2101
sigsetjmp(jmpenv, 1);
2104
AC_MSG_RESULT([yes])
2105
AC_DEFINE(HAVE_SIGSETJMP, 1, [If you have sigsetjmp])
2069
AC_CHECK_FUNCS([basename \
2091
eval skipcheck=\$skipcheck_$func
2092
if test "x$skipcheck" != "xyes"; then
2093
AC_MSG_CHECKING([deeper for $func])
2100
AC_MSG_RESULT([yes])
2101
eval "ac_cv_func_$func=yes"
2102
AC_DEFINE_UNQUOTED([AS_TR_CPP([HAVE_$func])], [1],
2103
[Define to 1 if you have the $func function.])
2105
AC_MSG_RESULT([but still no])
2111
2111
AC_CHECK_DECL(basename, ,
2112
2112
AC_DEFINE(NEED_BASENAME_PROTO, 1, [If you lack a fine basename() prototype]),
2124
AC_CHECK_DECL(inet_pton, ,
2125
AC_DEFINE(HAVE_NO_INET_PTON_PROTO, 1,
2126
[Defined if no inet_pton() prototype available]),
2128
#ifdef HAVE_ARPA_INET_H
2129
#include <arpa/inet.h>
2134
2125
dnl Check if the getnameinfo function is available
2135
2126
dnl and get the types of five of its arguments.
2136
2127
CURL_CHECK_FUNC_GETNAMEINFO
2138
2129
if test "$ipv6" = "yes"; then
2139
CURL_CHECK_WORKING_GETADDRINFO
2130
if test "$ac_cv_func_getaddrinfo" = "yes"; then
2131
AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
2133
AC_SUBST(IPV6_ENABLED)
2140
2135
CURL_CHECK_NI_WITHSCOPEID
2143
AC_MSG_CHECKING([if we are Mac OS X (to disable poll)])
2152
AC_MSG_RESULT($disable_poll)
2154
if test "$disable_poll" = "no"; then
2156
dnl poll() might be badly emulated, as in Mac OS X 10.3 (and other BSDs?) and
2157
dnl to find out we make an extra check here!
2158
if test "$ac_cv_func_poll" = "yes"; then
2159
AC_MSG_CHECKING([if poll works with NULL inputs])
2161
#ifdef HAVE_SYS_POLL_H
2162
#include <sys/poll.h>
2163
#elif defined(HAVE_POLL_H)
2169
/* make this return 0 == timeout since there's nothing to read from */
2170
return poll((void *)0, 0, 10 /*ms*/);
2174
AC_DEFINE(HAVE_POLL_FINE, 1, [If you have a fine poll]),
2176
AC_MSG_RESULT(cross-compiling assumes yes)
2177
AC_DEFINE(HAVE_POLL_FINE, 1, [If you have a fine poll])
2178
) dnl end of AC_RUN_IFELSE
2179
fi dnl poll() was found
2180
fi dnl poll()-check is not disabled
2138
dnl ************************************************************
2139
dnl enable non-blocking communications
2141
CURL_CHECK_OPTION_NONBLOCKING
2142
CURL_CHECK_NONBLOCKING_SOCKET
2144
dnl ************************************************************
2145
dnl nroff tool stuff
2183
2148
AC_PATH_PROG( PERL, perl, ,
2184
2149
$PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
2353
2318
dnl ************************************************************
2354
dnl lame option to switch on debug options
2356
AC_MSG_CHECKING([whether to enable debug options])
2357
AC_ARG_ENABLE(debug,
2358
AC_HELP_STRING([--enable-debug],[Enable pedantic debug options])
2359
AC_HELP_STRING([--disable-debug],[Disable debug options]),
2360
[ case "$enableval" in
2364
*) AC_MSG_RESULT(yes)
2366
CPPFLAGS="$CPPFLAGS -DCURLDEBUG"
2369
dnl set compiler "debug" options to become more picky, and remove
2370
dnl optimize options from CFLAGS
2378
dnl ************************************************************
2379
2319
dnl disable cryptographic authentication
2381
2321
AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
2455
2395
dnl ************************************************************
2396
dnl enforce SONAME bump
2399
AC_MSG_CHECKING([whether to enforce SONAME bump])
2400
AC_ARG_ENABLE(soname-bump,
2401
AC_HELP_STRING([--enable-soname-bump],[Enable enforced SONAME bump])
2402
AC_HELP_STRING([--disable-soname-bump],[Disable enforced SONAME bump]),
2403
[ case "$enableval" in
2404
yes) AC_MSG_RESULT(yes)
2411
AC_MSG_RESULT($soname_bump)
2413
AM_CONDITIONAL(SONAME_BUMP, test x$soname_bump = xyes)
2416
dnl ************************************************************
2456
2417
if test ! -z "$winsock_LIB"; then
2458
2419
dnl If ws2_32 is wanted, make sure it is the _last_ lib in LIBS (makes
2481
2442
AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
2445
dnl For keeping supported features and protocols also in pkg-config file
2446
dnl since it is more cross-compile frient than curl-config
2449
if test "x$USE_SSLEAY" = "x1"; then
2450
SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
2451
elif test -n "$SSL_ENABLED"; then
2452
SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
2454
if test "@KRB4_ENABLED@" = "x1"; then
2455
SUPPORT_FEATURES="$SUPPORT_FEATURES KRB4"
2457
if test "x$IPV6_ENABLED" = "x1"; then
2458
SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
2460
if test "x$HAVE_LIBZ" = "x1"; then
2461
SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
2463
if test "x$HAVE_ARES" = "x1"; then
2464
SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
2466
if test "x$IDN_ENABLED" = "x1"; then
2467
SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
2469
if test "x$USE_WINDOWS_SSPI" = "x1"; then
2470
SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
2472
if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" -o "x$GNUTLS_ENABLED" = "x1"; then
2473
SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
2476
AC_SUBST(SUPPORT_FEATURES)
2478
dnl For supported protocols in pkg-config file
2479
if test "x$CURL_DISABLE_HTTP" != "x1"; then
2480
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
2481
if test "x$SSL_ENABLED" = "x1"; then
2482
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
2485
if test "x$CURL_DISABLE_FTP" != "x1"; then
2486
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
2487
if test "x$SSL_ENABLED" = "x1"; then
2488
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
2491
if test "x$CURL_DISABLE_FILE" != "x1"; then
2492
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
2494
if test "x$CURL_DISABLE_TELNET" != "x1"; then
2495
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
2497
if test "x$CURL_DISABLE_LDAP" != "x1"; then
2498
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
2500
if test "x$CURL_DISABLE_LDAPS" != "x1"; then
2501
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
2503
if test "x$CURL_DISABLE_DICT" != "x1"; then
2504
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
2506
if test "x$CURL_DISABLE_TFTP" != "x1"; then
2507
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
2509
if test "x$USE_LIBSSH2" = "x1"; then
2510
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
2511
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
2514
AC_SUBST(SUPPORT_PROTOCOLS)
2516
dnl squeeze whitespace out of some variables
2525
squeeze LIBCURL_LIBS
2526
squeeze TEST_SERVER_LIBS
2483
2528
AC_CONFIG_FILES([Makefile \
2484
2529
docs/Makefile \
2485
2530
docs/examples/Makefile \