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

« back to all changes in this revision

Viewing changes to docs/libcurl/libcurl.m4

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2006-06-29 15:04:24 UTC
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20060629150424-be178abcwks1n519
Tags: upstream-7.15.4
ImportĀ upstreamĀ versionĀ 7.15.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# LIBCURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION],
2
2
#                       [ACTION-IF-YES], [ACTION-IF-NO])
3
3
# ----------------------------------------------------------
4
 
#      David Shaw <dshaw@jabberwocky.com>   Jun-21-2005
 
4
#      David Shaw <dshaw@jabberwocky.com>   May-09-2006
5
5
#
6
6
# Checks for libcurl.  DEFAULT-ACTION is the string yes or no to
7
7
# specify whether to default to --with-libcurl or --without-libcurl.
13
13
# ACTION-IF-NO is a list of shell commands that are run otherwise.
14
14
# Note that using --without-libcurl does run ACTION-IF-NO.
15
15
#
16
 
# This macro defines HAVE_LIBCURL if a working libcurl setup is found,
17
 
# and sets @LIBCURL@ and @LIBCURL_CPPFLAGS@ to the necessary values.
18
 
# Other useful defines are LIBCURL_FEATURE_xxx where xxx are the
19
 
# various features supported by libcurl, and LIBCURL_PROTOCOL_yyy
 
16
# This macro #defines HAVE_LIBCURL if a working libcurl setup is
 
17
# found, and sets @LIBCURL@ and @LIBCURL_CPPFLAGS@ to the necessary
 
18
# values.  Other useful defines are LIBCURL_FEATURE_xxx where xxx are
 
19
# the various features supported by libcurl, and LIBCURL_PROTOCOL_yyy
20
20
# where yyy are the various protocols supported by libcurl.  Both xxx
21
21
# and yyy are capitalized.  See the list of AH_TEMPLATEs at the top of
22
22
# the macro for the complete list of possible defines.  Shell
32
32
# found is after version 7.7.2, the first version that included the
33
33
# curl-config script.  Note that it is very important for people
34
34
# packaging binary versions of libcurl to include this script!
35
 
# Without curl-config, we can only guess what protocols are available.
 
35
# Without curl-config, we can only guess what protocols are available,
 
36
# or use curl_version_info to figure it out at runtime.
36
37
 
37
38
AC_DEFUN([LIBCURL_CHECK_CONFIG],
38
39
[
41
42
  AH_TEMPLATE([LIBCURL_FEATURE_IPV6],[Defined if libcurl supports IPv6])
42
43
  AH_TEMPLATE([LIBCURL_FEATURE_LIBZ],[Defined if libcurl supports libz])
43
44
  AH_TEMPLATE([LIBCURL_FEATURE_ASYNCHDNS],[Defined if libcurl supports AsynchDNS])
 
45
  AH_TEMPLATE([LIBCURL_FEATURE_IDN],[Defined if libcurl supports IDN])
 
46
  AH_TEMPLATE([LIBCURL_FEATURE_SSPI],[Defined if libcurl supports SSPI])
 
47
  AH_TEMPLATE([LIBCURL_FEATURE_NTLM],[Defined if libcurl supports NTLM])
44
48
 
45
49
  AH_TEMPLATE([LIBCURL_PROTOCOL_HTTP],[Defined if libcurl supports HTTP])
46
50
  AH_TEMPLATE([LIBCURL_PROTOCOL_HTTPS],[Defined if libcurl supports HTTPS])
47
51
  AH_TEMPLATE([LIBCURL_PROTOCOL_FTP],[Defined if libcurl supports FTP])
48
52
  AH_TEMPLATE([LIBCURL_PROTOCOL_FTPS],[Defined if libcurl supports FTPS])
49
 
  AH_TEMPLATE([LIBCURL_PROTOCOL_GOPHER],[Defined if libcurl supports GOPHER])
50
53
  AH_TEMPLATE([LIBCURL_PROTOCOL_FILE],[Defined if libcurl supports FILE])
51
54
  AH_TEMPLATE([LIBCURL_PROTOCOL_TELNET],[Defined if libcurl supports TELNET])
52
55
  AH_TEMPLATE([LIBCURL_PROTOCOL_LDAP],[Defined if libcurl supports LDAP])
53
56
  AH_TEMPLATE([LIBCURL_PROTOCOL_DICT],[Defined if libcurl supports DICT])
 
57
  AH_TEMPLATE([LIBCURL_PROTOCOL_TFTP],[Defined if libcurl supports TFTP])
54
58
 
55
59
  AC_ARG_WITH(libcurl,
56
60
     AC_HELP_STRING([--with-libcurl=DIR],[look for the curl library in DIR]),
65
69
     _libcurl_try_link=yes
66
70
 
67
71
     if test -d "$_libcurl_with" ; then
68
 
        CPPFLAGS="${CPPFLAGS} -I$withval/include"
69
 
        LDFLAGS="${LDFLAGS} -L$withval/lib"
 
72
        LIBCURL_CPPFLAGS="-I$withval/include"
 
73
        _libcurl_ldflags="-L$withval/lib"
 
74
        AC_PATH_PROG([_libcurl_config],["$withval/bin/curl-config"])
 
75
     else
 
76
        AC_PATH_PROG([_libcurl_config],[curl-config])
70
77
     fi
71
78
 
72
 
     AC_PATH_PROG([_libcurl_config],[curl-config])
73
 
 
74
79
     if test x$_libcurl_config != "x" ; then
75
80
        AC_CACHE_CHECK([for the version of libcurl],
76
81
           [libcurl_cv_lib_curl_version],
126
131
 
127
132
        # we didn't find curl-config, so let's see if the user-supplied
128
133
        # link line (or failing that, "-lcurl") is enough.
129
 
        LIBCURL=${LIBCURL-"-lcurl"}
 
134
        LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"}
130
135
 
131
136
        AC_CACHE_CHECK([whether libcurl is usable],
132
137
           [libcurl_cv_lib_curl_usable],
133
138
           [
134
139
           _libcurl_save_cppflags=$CPPFLAGS
135
 
           CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"
 
140
           CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS"
136
141
           _libcurl_save_libs=$LIBS
137
 
           LIBS="$LIBS $LIBCURL"
 
142
           LIBS="$LIBCURL $LIBS"
138
143
 
139
144
           AC_LINK_IFELSE(AC_LANG_PROGRAM([#include <curl/curl.h>],[
140
145
/* Try and use a few common options to force a failure if we are
188
193
 
189
194
              # We don't have --protocols, so just assume that all
190
195
              # protocols are available
191
 
              _libcurl_protocols="HTTP FTP GOPHER FILE TELNET LDAP DICT"
 
196
              _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT"
192
197
 
193
198
              if test x$libcurl_feature_SSL = xyes ; then
194
199
                 _libcurl_protocols="$_libcurl_protocols HTTPS"
205
210
              AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_protocol_$_libcurl_protocol),[1])
206
211
              eval AS_TR_SH(libcurl_protocol_$_libcurl_protocol)=yes
207
212
           done
 
213
        else
 
214
           unset LIBCURL
 
215
           unset LIBCURL_CPPFLAGS
208
216
        fi
209
217
     fi
210
218
 
216
224
     unset _libcurl_protocol
217
225
     unset _libcurl_protocols
218
226
     unset _libcurl_version
 
227
     unset _libcurl_ldflags
219
228
  fi
220
229
 
221
230
  if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then