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
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.
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.
37
38
AC_DEFUN([LIBCURL_CHECK_CONFIG],
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])
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])
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
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"])
76
AC_PATH_PROG([_libcurl_config],[curl-config])
72
AC_PATH_PROG([_libcurl_config],[curl-config])
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],
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"}
131
136
AC_CACHE_CHECK([whether libcurl is usable],
132
137
[libcurl_cv_lib_curl_usable],
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"
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
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"
193
198
if test x$libcurl_feature_SSL = xyes ; then
194
199
_libcurl_protocols="$_libcurl_protocols HTTPS"