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.273 2008-01-28 11:48:41 bagder Exp $
21
# $Id: configure.ac,v 1.300 2008-05-26 15:09:28 bagder Exp $
22
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
AC_INIT(curl, [-], [a suitable curl mailing list => http://curl.haxx.se/mail/])
28
AC_INIT([curl], [-], [a suitable curl mailing list => http://curl.haxx.se/mail/])
30
30
dnl configure script copyright
31
31
AC_COPYRIGHT([Copyright (c) 1998 - 2008 Daniel Stenberg, <daniel@haxx.se>
220
220
dnl **********************************************************************
222
222
CURL_CHECK_HEADER_WINDOWS
223
CURL_CHECK_HEADER_WINSOCK
224
CURL_CHECK_HEADER_WINSOCK2
225
CURL_CHECK_HEADER_WS2TCPIP
227
CURL_CHECK_HEADER_WINLDAP
228
CURL_CHECK_HEADER_WINBER
223
CURL_CHECK_NATIVE_WINDOWS
224
case X-"$ac_cv_native_windows" in
226
CURL_CHECK_HEADER_WINSOCK
227
CURL_CHECK_HEADER_WINSOCK2
228
CURL_CHECK_HEADER_WS2TCPIP
229
CURL_CHECK_HEADER_WINLDAP
230
CURL_CHECK_HEADER_WINBER
233
ac_cv_header_winsock_h="no"
234
ac_cv_header_winsock2_h="no"
235
ac_cv_header_ws2tcpip_h="no"
236
ac_cv_header_winldap_h="no"
237
ac_cv_header_winber_h="no"
230
241
dnl **********************************************************************
231
242
dnl platform/compiler/architecture specific checks/flags
478
489
AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
479
490
my_ac_save_LIBS=$LIBS
480
491
LIBS="-lnsl -lsocket $LIBS"
484
HAVE_GETHOSTBYNAME="1"
485
AC_MSG_RESULT([yes])],
489
LIBS=$my_ac_save_LIBS]
499
HAVE_GETHOSTBYNAME="1"
502
LIBS=$my_ac_save_LIBS
493
506
if test "$HAVE_GETHOSTBYNAME" != "1"
495
dnl This is for Msys/Mingw
496
AC_MSG_CHECKING([for gethostbyname in ws2_32])
497
my_ac_save_LIBS=$LIBS
498
LIBS="-lws2_32 $LIBS"
499
AC_TRY_LINK([#include <winsock2.h>],
500
[gethostbyname("www.dummysite.com");],
504
HAVE_GETHOSTBYNAME="1"],
505
[ dnl failed, restore LIBS
506
LIBS=$my_ac_save_LIBS
508
dnl This is for winsock systems
509
if test "$ac_cv_header_windows_h" = "yes"; then
510
if test "$ac_cv_header_winsock_h" = "yes"; then
513
winsock_LIB="-lwinsock"
516
winsock_LIB="-lwsock32"
520
if test "$ac_cv_header_winsock2_h" = "yes"; then
521
winsock_LIB="-lws2_32"
523
if test ! -z "$winsock_LIB"; then
524
my_ac_save_LIBS=$LIBS
525
LIBS="$winsock_LIB $LIBS"
526
AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
529
#ifdef HAVE_WINDOWS_H
530
#ifndef WIN32_LEAN_AND_MEAN
531
#define WIN32_LEAN_AND_MEAN
534
#ifdef HAVE_WINSOCK2_H
535
#include <winsock2.h>
537
#ifdef HAVE_WINSOCK_H
543
gethostbyname("www.dummysite.com");
547
HAVE_GETHOSTBYNAME="1"
551
LIBS=$my_ac_save_LIBS
511
557
if test "$HAVE_GETHOSTBYNAME" != "1"
513
559
dnl This is for Minix 3.1
514
560
AC_MSG_CHECKING([for gethostbyname for Minix 3])
516
563
/* Older Minix versions may need <net/gen/netdb.h> here instead */
518
[gethostbyname("www.dummysite.com");],
521
HAVE_GETHOSTBYNAME="1"],
566
gethostbyname("www.dummysite.com");
570
HAVE_GETHOSTBYNAME="1"
526
576
if test "$HAVE_GETHOSTBYNAME" != "1"
528
578
dnl This is for eCos with a stubbed DNS implementation
529
579
AC_MSG_CHECKING([for gethostbyname for eCos])
531
582
#include <stdio.h>
533
[gethostbyname("www.dummysite.com");],
536
HAVE_GETHOSTBYNAME="1"],
585
gethostbyname("www.dummysite.com");
589
HAVE_GETHOSTBYNAME="1"
595
if test "$HAVE_GETHOSTBYNAME" != "1"
597
dnl gethostbyname in the network lib - for Haiku OS
598
AC_CHECK_LIB(network, gethostbyname,
599
[HAVE_GETHOSTBYNAME="1"
600
LIBS="$LIBS -lnetwork"
541
604
if test "$HAVE_GETHOSTBYNAME" != "1"
568
631
AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
570
633
dnl **********************************************************************
634
dnl In case that function clock_gettime with monotonic timer is available,
635
dnl check for additional required libraries.
636
dnl **********************************************************************
637
CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
639
dnl **********************************************************************
571
640
dnl The preceding library checks are all potentially useful for test
572
641
dnl servers (for providing networking support). Save the list of required
573
642
dnl libraries at this point for use while linking those test servers.
625
694
AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
626
695
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
627
696
AC_SUBST(CURL_DISABLE_LDAP, [1])])
697
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
698
AC_SUBST(CURL_DISABLE_LDAPS, [1])
629
700
dnl Try to find the right ldap libraries for this system
630
701
CURL_CHECK_LIBS_LDAP
633
704
AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
634
705
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
635
706
AC_SUBST(CURL_DISABLE_LDAP, [1])
707
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
708
AC_SUBST(CURL_DISABLE_LDAPS, [1])
648
721
AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
649
722
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
650
723
AC_SUBST(CURL_DISABLE_LDAP, [1])])
724
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
725
AC_SUBST(CURL_DISABLE_LDAPS, [1])
671
746
dnl **********************************************************************
672
dnl Check for the presence of the winmm library.
673
dnl **********************************************************************
677
dnl Under Cygwin, winmm exists but is not needed as WIN32 is not #defined
678
dnl and gettimeofday() will be used regardless of the outcome of this test.
679
dnl Skip this test, otherwise -lwinmm will be needlessly added to LIBS
680
dnl (and recorded as such in the .la file, potentially affecting downstream
681
dnl clients of the library.)
684
AC_MSG_CHECKING([for timeGetTime in winmm])
685
my_ac_save_LIBS=$LIBS
687
AC_TRY_LINK([#include <windef.h>
688
#include <mmsystem.h>
694
[ dnl failed, restore LIBS
695
LIBS=$my_ac_save_LIBS
701
dnl **********************************************************************
702
747
dnl Checks for IPv6
703
748
dnl **********************************************************************
980
dnl not found, check Heimdal
981
AC_CHECK_HEADER(gssapi.h,
983
dnl found in the given dirs
984
AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
987
dnl not found, check in gssapi/ subdir
988
AC_CHECK_HEADER(gssapi/gssapi.h,
1025
dnl not found, check Heimdal or MIT
1027
[gssapi/gssapi.h gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
1030
if test "x$not_mit" = "x1"; then
1031
dnl MIT not found, check for Heimdal
1032
AC_CHECK_HEADER(gssapi.h,
991
AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
1035
AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
994
1038
dnl no header found, disabling GSS
996
1040
AC_MSG_WARN(disabling GSSAPI since no header files was found)
1045
AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
1046
dnl check if we have a really old MIT kerberos (<= 1.2)
1047
AC_MSG_CHECKING([if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE])
1049
#include <gssapi/gssapi.h>
1050
#include <gssapi/gssapi_generic.h>
1051
#include <gssapi/gssapi_krb5.h>
1056
GSS_C_NT_HOSTBASED_SERVICE,
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])
1011
1077
if test -n "$gnu_gss"; then
1012
1078
curl_gss_msg="enabled (GNU GSS)"
1013
LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR -lgss"
1079
LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1014
1081
elif test -z "$GSSAPI_LIB_DIR"; then
1015
1082
if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
1016
gss_ldflags=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
1017
LDFLAGS="$LDFLAGS $gss_ldflags"
1083
dnl krb5-config doesn't have --libs-only-L or similar, put everything
1085
gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
1086
LIBS="$LIBS $gss_libs"
1018
1087
elif test "$GSSAPI_ROOT" != "yes"; then
1019
LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff -lgssapi"
1088
LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
1089
LIBS="$LIBS -lgssapi"
1021
LDFLAGS="$LDFLAGS -lgssapi"
1091
LIBS="$LIBS -lgssapi"
1024
LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR -lgssapi"
1094
LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1095
LIBS="$LIBS -lgssapi"
1027
1098
CPPFLAGS="$save_CPPFLAGS"
1230
1301
dnl and acting like OpenSSL.
1232
1303
AC_MSG_CHECKING([for yaSSL using OpenSSL compatibility mode])
1234
1306
#include <openssl/ssl.h>
1236
1308
#if defined(YASSL_VERSION) && defined(OPENSSL_VERSION_NUMBER)
1237
1309
int dummy = SSL_ERROR_NONE;
1239
1311
Not the yaSSL OpenSSL compatibility header.
1242
AC_MSG_RESULT([yes])
1243
AC_DEFINE_UNQUOTED(USE_YASSLEMUL, 1,
1244
[Define to 1 if using yaSSL in OpenSSL compatibility mode.])
1245
curl_ssl_msg="enabled (OpenSSL emulation by yaSSL)"
1315
AC_MSG_RESULT([yes])
1316
AC_DEFINE_UNQUOTED(USE_YASSLEMUL, 1,
1317
[Define to 1 if using yaSSL in OpenSSL compatibility mode.])
1318
curl_ssl_msg="enabled (OpenSSL emulation by yaSSL)"
1370
1443
dnl --with-libssh2 (without path) used
1371
1444
PREFIX_LIBSSH2=/usr/local/lib
1372
LIB_LIBSSH2="$PREFIX_LIBSSH2/lib$libsuff"
1445
LIB_LIBSSH2="$PREFIX_LIBSSH2$libsuff"
1375
1448
dnl no --with-libssh2 option given, just check default places
1610
1683
dnl Check for the CA bundle
1611
1684
dnl **********************************************************************
1613
if test X"$SSL_ENABLED" != "X"; then
1615
AC_MSG_CHECKING([CA cert bundle install path])
1617
AC_ARG_WITH(ca-bundle,
1618
AC_HELP_STRING([--with-ca-bundle=FILE], [File name to install the CA bundle as])
1619
AC_HELP_STRING([--without-ca-bundle], [Don't install the CA bundle]),
1622
if test "x$prefix" != xNONE; then
1623
ca="\${prefix}/share/curl/curl-ca-bundle.crt"
1625
ca="$ac_default_prefix/share/curl/curl-ca-bundle.crt"
1629
if test "x$ca" != "xno"; then
1630
CURL_CA_BUNDLE='"'$ca'"'
1631
AC_SUBST(CURL_CA_BUNDLE)
1633
AC_MSG_RESULT([$ca])
1634
fi dnl only done if some kind of SSL was enabled
1636
AM_CONDITIONAL(CABUNDLE, test x$ca != xno)
1686
CURL_CHECK_CA_BUNDLE
1638
1688
dnl **********************************************************************
1639
1689
dnl Check for the presence of IDN libraries and headers
1771
1821
dnl the optimizer assumes that pointers can only point to
1772
1822
dnl an object of the same type.
1773
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"
2035
dnl For some reason, the check above doesn't properly detect select() with
2037
if test "$ac_cv_func_select" = "no"; then
2038
AC_MSG_CHECKING([for select in ws2_32])
2041
#ifdef HAVE_WINDOWS_H
2042
#ifndef WIN32_LEAN_AND_MEAN
2043
#define WIN32_LEAN_AND_MEAN
2045
#include <windows.h>
2046
#ifdef HAVE_WINSOCK2_H
2047
#include <winsock2.h>
2049
#ifdef HAVE_WINSOCK_H
2050
#include <winsock.h>
2055
select(0,(fd_set *)NULL,(fd_set *)NULL,(fd_set *)NULL,(struct timeval *)NULL);
2057
AC_MSG_RESULT([yes])
2059
AC_DEFINE_UNQUOTED(HAVE_SELECT, 1,
2060
[Define to 1 if you have the select function.])
2062
AC_MSG_ERROR([You can't compile without a select])
2066
2092
dnl sigsetjmp() might be a macro and no function so if it isn't found already
2067
2093
dnl we make an extra check here!
2068
2094
if test "$ac_cv_func_sigsetjmp" != "yes"; then
2069
2095
AC_MSG_CHECKING([for sigsetjmp defined as macro])
2070
AC_TRY_LINK( [#include <setjmp.h>],
2072
sigsetjmp(jmpenv, 1);],
2074
AC_DEFINE(HAVE_SIGSETJMP, 1, [If you have sigsetjmp]),
2101
sigsetjmp(jmpenv, 1);
2104
AC_MSG_RESULT([yes])
2105
AC_DEFINE(HAVE_SIGSETJMP, 1, [If you have sigsetjmp])
2079
2111
AC_CHECK_DECL(basename, ,
2247
2279
dnl out and don't use the "embedded" ares dir (in which case we don't
2248
2280
dnl check it because it might not have been built yet)
2249
2281
AC_MSG_CHECKING([that c-ares is good and recent enough])
2251
2284
#include <ares.h>
2252
/* provide a set of dummy functions in case c-ares was built with debug */
2253
void curl_dofree() { }
2254
void curl_sclose() { }
2255
void curl_domalloc() { }
2259
ares_channel channel;
2260
ares_cancel(channel); /* added in 1.2.0 */
2261
ares_process_fd(channel, 0, 0); /* added in 1.4.0 */
2267
AC_MSG_ERROR([c-ares library defective or too old])
2285
/* set of dummy functions in case c-ares was built with debug */
2286
void curl_dofree() { }
2287
void curl_sclose() { }
2288
void curl_domalloc() { }
2289
void curl_docalloc() { }
2290
void curl_socket() { }
2292
ares_channel channel;
2293
ares_cancel(channel); /* added in 1.2.0 */
2294
ares_process_fd(channel, 0, 0); /* added in 1.4.0 */
2297
AC_MSG_RESULT([yes])
2300
AC_MSG_ERROR([c-ares library defective or too old])
2424
2455
dnl ************************************************************
2425
if test "x$ws2" = "xyes"; then
2456
if test ! -z "$winsock_LIB"; then
2427
2458
dnl If ws2_32 is wanted, make sure it is the _last_ lib in LIBS (makes
2428
2459
dnl things work when built with c-ares). But we can't just move it last
2429
2460
dnl since then other stuff (SSL) won't build. So we simply append it to the
2432
LIBS="$LIBS -lws2_32"
2433
TEST_SERVER_LIBS="$TEST_SERVER_LIBS -lws2_32"
2463
LIBS="$LIBS $winsock_LIB"
2464
TEST_SERVER_LIBS="$TEST_SERVER_LIBS $winsock_LIB"
2500
2531
Built-in manual: ${curl_manual_msg}
2501
2532
Verbose errors: ${curl_verbose_msg}
2502
2533
SSPI support: ${curl_sspi_msg}
2534
ca cert bundle: ${ca}
2535
ca cert path: ${capath}
2504
2536
LDAP support: ${curl_ldap_msg}
2505
2537
LDAPS support: ${curl_ldaps_msg}