~ubuntu-branches/ubuntu/gutsy/curl/gutsy

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2006-06-29 15:04:24 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20060629150424-pn00qumt9sml8p4m
Tags: 7.15.4-1ubuntu1
Synchronize to Debian. Only change left: Removal of stunnel and
libdb4.2-dev build dependencies.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl $Id: configure.ac,v 1.171 2005/11/29 16:17:53 bagder Exp $
 
1
#***************************************************************************
 
2
#                                  _   _ ____  _
 
3
#  Project                     ___| | | |  _ \| |
 
4
#                             / __| | | | |_) | |
 
5
#                            | (__| |_| |  _ <| |___
 
6
#                             \___|\___/|_| \_\_____|
 
7
#
 
8
# Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
 
9
#
 
10
# This software is licensed as described in the file COPYING, which
 
11
# you should have received as part of this distribution. The terms
 
12
# are also available at http://curl.haxx.se/docs/copyright.html.
 
13
#
 
14
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
 
15
# copies of the Software, and permit persons to whom the Software is
 
16
# furnished to do so, under the terms of the COPYING file.
 
17
#
 
18
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
 
19
# KIND, either express or implied.
 
20
#
 
21
# $Id: configure.ac,v 1.196 2006-06-08 06:12:30 bagder Exp $
 
22
###########################################################################
2
23
dnl Process this file with autoconf to produce a configure script.
3
24
 
4
25
AC_PREREQ(2.57)
140
161
dnl AC_PROG_INSTALL
141
162
AC_PROG_MAKE_SET
142
163
 
 
164
dnl **********************************************************************
 
165
dnl Make sure that our checks for headers windows.h winsock.h winsock2.h 
 
166
dnl and ws2tcpip.h take precedence over any other further checks which 
 
167
dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
 
168
dnl this specific header files. And do them before its results are used.
 
169
dnl **********************************************************************
 
170
 
 
171
CURL_CHECK_HEADER_WINDOWS
 
172
CURL_CHECK_HEADER_WINSOCK
 
173
CURL_CHECK_HEADER_WINSOCK2
 
174
CURL_CHECK_HEADER_WS2TCPIP
 
175
 
 
176
 
143
177
dnl ************************************************************
144
178
dnl switch off particular protocols
145
179
dnl
151
185
  no)
152
186
       AC_MSG_RESULT(no)
153
187
       AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
154
 
       AC_MSG_WARN([disable HTTP disables FTP over proxy and GOPHER too])
155
 
       AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable GOPHER])
 
188
       AC_MSG_WARN([disable HTTP disables FTP over proxy])
156
189
       AC_SUBST(CURL_DISABLE_HTTP, [1])
157
 
       AC_SUBST(CURL_DISABLE_GOPHER, [1])
158
190
       ;;
159
191
  *)   AC_MSG_RESULT(yes)
160
192
       ;;
176
208
  esac ],
177
209
       AC_MSG_RESULT(yes)
178
210
)
179
 
AC_MSG_CHECKING([whether to support gopher])
180
 
AC_ARG_ENABLE(gopher,
181
 
AC_HELP_STRING([--enable-gopher],[Enable GOPHER support])
182
 
AC_HELP_STRING([--disable-gopher],[Disable GOPHER support]),
183
 
[ case "$enableval" in
184
 
  no)
185
 
       AC_MSG_RESULT(no)
186
 
       AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable GOPHER])
187
 
       AC_SUBST(CURL_DISABLE_GOPHER, [1])
188
 
       ;;
189
 
  *)   AC_MSG_RESULT(yes)
190
 
       ;;
191
 
  esac ],
192
 
       AC_MSG_RESULT(yes)
193
 
)
194
211
AC_MSG_CHECKING([whether to support file])
195
212
AC_ARG_ENABLE(file,
196
213
AC_HELP_STRING([--enable-file],[Enable FILE support])
289
306
dnl The actual use of the USE_MANUAL variable is done much later in this
290
307
dnl script to allow other actions to disable it as well.
291
308
 
 
309
dnl **********************************************************************
 
310
dnl check if this is the Intel ICC compiler, and if so make it stricter
 
311
dnl (convert warning 147 into an error) so that it properly can detect the
 
312
dnl gethostbyname_r() version
 
313
dnl **********************************************************************
 
314
CURL_DETECT_ICC([CFLAGS="$CFLAGS -we 147"])
292
315
 
293
316
dnl **********************************************************************
294
317
dnl Checks for libraries.
449
472
dnl Check for the presence of the winmm library.
450
473
dnl **********************************************************************
451
474
 
452
 
AC_MSG_CHECKING([for timeGetTime in winmm])
453
 
my_ac_save_LIBS=$LIBS
454
 
LIBS="-lwinmm $LIBS"
455
 
AC_TRY_LINK([#include <windef.h>
456
 
             #include <mmsystem.h>
457
 
             ],
458
 
             [timeGetTime();],
459
 
             [ dnl worked!
460
 
             AC_MSG_RESULT([yes])
461
 
             ],
462
 
             [ dnl failed, restore LIBS
463
 
             LIBS=$my_ac_save_LIBS
464
 
             AC_MSG_RESULT(no)]
465
 
           )
 
475
case $host in
 
476
  *-*-cygwin*)
 
477
    dnl Under Cygwin, winmm exists but is not needed as WIN32 is not #defined
 
478
    dnl and gettimeofday() will be used regardless of the outcome of this test.
 
479
    dnl Skip this test, otherwise -lwinmm will be needlessly added to LIBS
 
480
    dnl (and recorded as such in the .la file, potentially affecting downstream
 
481
    dnl clients of the library.)
 
482
    ;;
 
483
  *)
 
484
    AC_MSG_CHECKING([for timeGetTime in winmm])
 
485
    my_ac_save_LIBS=$LIBS
 
486
    LIBS="-lwinmm $LIBS"
 
487
    AC_TRY_LINK([#include <windef.h>
 
488
                 #include <mmsystem.h>
 
489
                 ],
 
490
                 [timeGetTime();],
 
491
                 [ dnl worked!
 
492
                 AC_MSG_RESULT([yes])
 
493
                 ],
 
494
                 [ dnl failed, restore LIBS
 
495
                 LIBS=$my_ac_save_LIBS
 
496
                 AC_MSG_RESULT(no)]
 
497
               )
 
498
    ;;
 
499
esac
466
500
 
467
501
dnl **********************************************************************
468
502
dnl Checks for IPv6
795
829
dnl Default to no CA bundle
796
830
ca="no"
797
831
AC_ARG_WITH(ssl,dnl
798
 
AC_HELP_STRING([--with-ssl=PATH],[where to look for SSL, PATH points to the SSL installation (default: /usr/local/ssl)])
 
832
AC_HELP_STRING([--with-ssl=PATH],[Where to look for OpenSSL, PATH points to the SSL installation (default: /usr/local/ssl); when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
799
833
AC_HELP_STRING([--without-ssl], [disable SSL]),
800
834
  OPT_SSL=$withval)
801
835
 
865
899
  fi
866
900
 
867
901
  dnl This is for Msys/Mingw
868
 
  AC_MSG_CHECKING([for gdi32])
869
 
  my_ac_save_LIBS=$LIBS
870
 
  LIBS="-lgdi32 $LIBS"
871
 
  AC_TRY_LINK([#include <windef.h>
872
 
               #include <wingdi.h>],
873
 
               [GdiFlush();],
874
 
               [ dnl worked!
875
 
               AC_MSG_RESULT([yes])],
876
 
               [ dnl failed, restore LIBS
877
 
               LIBS=$my_ac_save_LIBS
878
 
               AC_MSG_RESULT(no)]
879
 
              )
 
902
  case $host in    
 
903
    *-*-cygwin*)
 
904
      dnl Under Cygwin this is extraneous and causes an unnecessary -lgdi32
 
905
      dnl to be added to LIBS and recorded in the .la file.
 
906
      ;;
 
907
    *)
 
908
      AC_MSG_CHECKING([for gdi32])
 
909
      my_ac_save_LIBS=$LIBS
 
910
      LIBS="-lgdi32 $LIBS"
 
911
      AC_TRY_LINK([#include <windef.h>
 
912
                   #include <wingdi.h>],
 
913
                   [GdiFlush();],
 
914
                   [ dnl worked!
 
915
                   AC_MSG_RESULT([yes])],
 
916
                   [ dnl failed, restore LIBS
 
917
                   LIBS=$my_ac_save_LIBS
 
918
                   AC_MSG_RESULT(no)]
 
919
                  )
 
920
      ;;
 
921
  esac
880
922
 
881
923
  AC_CHECK_LIB(crypto, CRYPTO_lock,[
882
924
     HAVECRYPTO="yes"
924
966
        AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]))
925
967
 
926
968
      if test $ac_cv_header_openssl_x509_h = no; then
927
 
        AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h,
 
969
        dnl we don't use the "action" part of the AC_CHECK_HEADERS macro
 
970
        dnl since 'err.h' might in fact find a krb4 header with the same
 
971
        dnl name
 
972
        AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h)
 
973
 
 
974
        if test $ac_cv_header_x509_h = yes && 
 
975
           test $ac_cv_header_crypto_h = yes &&
 
976
           test $ac_cv_header_ssl_h = yes; then
 
977
          dnl three matches
928
978
          curl_ssl_msg="enabled (OpenSSL)"
929
 
          OPENSSL_ENABLED=1)
 
979
          OPENSSL_ENABLED=1
 
980
        fi
930
981
      fi
931
982
    fi
932
983
 
1047
1098
    fi
1048
1099
    if test -n "$addlib"; then
1049
1100
 
1050
 
      CLEANLDFLAGS="$LDFLAGS"
 
1101
      CLEANLIBS="$LIBS"
1051
1102
      CLEANCPPFLAGS="$CPPFLAGS"
1052
1103
  
1053
 
      LDFLAGS="$LDFLAGS $addlib"
 
1104
      LIBS="$LIBS $addlib"
1054
1105
      if test "$addcflags" != "-I/usr/include"; then
1055
1106
         CPPFLAGS="$CPPFLAGS $addcflags"
1056
1107
      fi
1063
1114
       curl_ssl_msg="enabled (GnuTLS)"
1064
1115
       ],
1065
1116
       [
1066
 
         LDFLAGS="$CLEANLDFLAGS"
 
1117
         LIBS="$CLEANLIBS"
1067
1118
         CPPFLAGS="$CLEANCPPFLAGS"
1068
1119
       ])
1069
1120
  
1329
1380
 
1330
1381
if test X"$OPT_THREAD" = Xoff
1331
1382
then
1332
 
  AC_DEFINE(DISABLED_THREADSAFE, 1, \
1333
 
Set to explicitly specify we don't want to use thread-safe functions)
 
1383
  AC_DEFINE(DISABLED_THREADSAFE, 1,
 
1384
    [Set to explicitly specify we don't want to use thread-safe functions])
1334
1385
else
1335
1386
  if test "$ipv6" != "yes"; then
1336
1387
    dnl dig around for gethostbyname_r()
1421
1472
     AC_MSG_RESULT(no)
1422
1473
    ,
1423
1474
    dnl not invoked when crosscompiling)
1424
 
    ])
 
1475
     echo "hej"
 
1476
    )
1425
1477
  fi
1426
1478
else
1427
1479
  dnl and for crosscompilings
1436
1488
dnl Checks for header files.
1437
1489
AC_HEADER_STDC
1438
1490
 
1439
 
dnl First check for the very most basic headers. Then we can use these
 
1491
 
 
1492
dnl Now check for the very most basic headers. Then we can use these
1440
1493
dnl ones as default-headers when checking for the rest!
1441
1494
AC_CHECK_HEADERS(
1442
1495
        sys/types.h \
1463
1516
        fcntl.h \
1464
1517
        dlfcn.h \
1465
1518
        alloca.h \
1466
 
        winsock.h \
1467
 
        winsock2.h \
1468
1519
        time.h \
1469
1520
        io.h \
1470
1521
        pwd.h \
1534
1585
AC_CHECK_TYPE(ssize_t, ,
1535
1586
   AC_DEFINE(ssize_t, int, [the signed version of size_t]))
1536
1587
 
1537
 
TYPE_SOCKLEN_T
 
1588
# Check for socklen_t or equivalent
 
1589
CURL_CHECK_TYPE_SOCKLEN_T
 
1590
 
1538
1591
TYPE_IN_ADDR_T
1539
1592
 
1540
1593
TYPE_SOCKADDR_STORAGE
1584
1637
                ftruncate \
1585
1638
                pipe \
1586
1639
                poll \
 
1640
                getprotobyname \
1587
1641
                getrlimit \
1588
 
                setrlimit,
 
1642
                setrlimit \
 
1643
                fork,
1589
1644
dnl if found
1590
1645
[],
1591
1646
dnl if not found, $ac_func is the name we check for
1606
1661
 
1607
1662
dnl For some reason, the check above doesn't properly detect select() with
1608
1663
dnl Msys/Mingw
1609
 
if test "$ac_cv_func_select" != "yes"; then
 
1664
if test "$ac_cv_func_select" = "no"; then
1610
1665
  AC_MSG_CHECKING([for select in ws2_32])
1611
 
  AC_TRY_LINK([#include <winsock2.h>],
1612
 
               [select(0,(fd_set *)NULL,(fd_set *)NULL,(fd_set *)NULL,(struct timeval *)NULL);],
1613
 
               [ dnl worked!
1614
 
               AC_MSG_RESULT([yes])
1615
 
               HAVE_SELECT="1"
1616
 
               AC_DEFINE_UNQUOTED(HAVE_SELECT,1)],
1617
 
               [AC_MSG_ERROR(You can't compile without a select)]
1618
 
             )
 
1666
  AC_TRY_LINK([
 
1667
#undef inline
 
1668
#ifdef HAVE_WINDOWS_H
 
1669
#ifndef WIN32_LEAN_AND_MEAN
 
1670
#define WIN32_LEAN_AND_MEAN
 
1671
#endif
 
1672
#include <windows.h>
 
1673
#ifdef HAVE_WINSOCK2_H
 
1674
#include <winsock2.h>
 
1675
#else
 
1676
#ifdef HAVE_WINSOCK_H
 
1677
#include <winsock.h>
 
1678
#endif
 
1679
#endif
 
1680
#endif
 
1681
    ],[
 
1682
      select(0,(fd_set *)NULL,(fd_set *)NULL,(fd_set *)NULL,(struct timeval *)NULL);
 
1683
    ],[ 
 
1684
      AC_MSG_RESULT([yes])
 
1685
      HAVE_SELECT="1"
 
1686
      AC_DEFINE_UNQUOTED(HAVE_SELECT, 1,
 
1687
        [Define to 1 if you have the select function.])
 
1688
    ],[
 
1689
      AC_MSG_ERROR([You can't compile without a select])
 
1690
  ])
1619
1691
fi
1620
1692
 
1621
1693
dnl sigsetjmp() might be a macro and no function so if it isn't found already
1654
1726
]
1655
1727
)
1656
1728
 
 
1729
dnl Check if the getnameinfo function is available
 
1730
dnl and get the types of five of its arguments.
 
1731
CURL_CHECK_FUNC_GETNAMEINFO
 
1732
 
1657
1733
AC_MSG_CHECKING([if we are Mac OS X (to disable poll)])
1658
1734
disable_poll=no
1659
1735
case $host in
1957
2033
           packages/EPM/curl.list \
1958
2034
           packages/EPM/Makefile \
1959
2035
           packages/vms/Makefile \
 
2036
           packages/AIX/Makefile \
 
2037
           packages/AIX/RPM/Makefile \
 
2038
           packages/AIX/RPM/curl.spec \
1960
2039
           curl-config \
1961
2040
           libcurl.pc
1962
2041
])