55
55
AH_TEMPLATE([LIBCURL_PROTOCOL_LDAP],[Defined if libcurl supports LDAP])
56
56
AH_TEMPLATE([LIBCURL_PROTOCOL_DICT],[Defined if libcurl supports DICT])
57
57
AH_TEMPLATE([LIBCURL_PROTOCOL_TFTP],[Defined if libcurl supports TFTP])
58
AH_TEMPLATE([LIBCURL_PROTOCOL_RTSP],[Defined if libcurl supports RTSP])
59
AH_TEMPLATE([LIBCURL_PROTOCOL_POP3],[Defined if libcurl supports POP3])
60
AH_TEMPLATE([LIBCURL_PROTOCOL_IMAP],[Defined if libcurl supports IMAP])
61
AH_TEMPLATE([LIBCURL_PROTOCOL_SMTP],[Defined if libcurl supports SMTP])
59
63
AC_ARG_WITH(libcurl,
60
64
AC_HELP_STRING([--with-libcurl=DIR],[look for the curl library in DIR]),
74
78
AC_PATH_PROG([_libcurl_config],[curl-config],["$withval/bin"],
77
AC_PATH_PROG([_libcurl_config],[curl-config])
81
AC_PATH_PROG([_libcurl_config],[curl-config])
80
84
if test x$_libcurl_config != "x" ; then
81
85
AC_CACHE_CHECK([for the version of libcurl],
82
[libcurl_cv_lib_curl_version],
86
[libcurl_cv_lib_curl_version],
83
87
[libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $[]2}'`])
85
_libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse`
86
_libcurl_wanted=`echo ifelse([$2],,[0],[$2]) | $_libcurl_version_parse`
89
_libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse`
90
_libcurl_wanted=`echo ifelse([$2],,[0],[$2]) | $_libcurl_version_parse`
88
92
if test $_libcurl_wanted -gt 0 ; then
89
AC_CACHE_CHECK([for libcurl >= version $2],
90
[libcurl_cv_lib_version_ok],
93
AC_CACHE_CHECK([for libcurl >= version $2],
94
[libcurl_cv_lib_version_ok],
92
if test $_libcurl_version -ge $_libcurl_wanted ; then
93
libcurl_cv_lib_version_ok=yes
95
libcurl_cv_lib_version_ok=no
96
if test $_libcurl_version -ge $_libcurl_wanted ; then
97
libcurl_cv_lib_version_ok=yes
99
libcurl_cv_lib_version_ok=no
100
if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then
104
if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then
101
105
if test x"$LIBCURL_CPPFLAGS" = "x" ; then
102
106
LIBCURL_CPPFLAGS=`$_libcurl_config --cflags`
105
109
LIBCURL=`$_libcurl_config --libs`
107
111
# This is so silly, but Apple actually has a bug in their
108
# curl-config script. Fixed in Tiger, but there are still
109
# lots of Panther installs around.
112
# curl-config script. Fixed in Tiger, but there are still
113
# lots of Panther installs around.
110
114
case "${host}" in
111
115
powerpc-apple-darwin7*)
112
116
LIBCURL=`echo $LIBCURL | sed -e 's|-arch i386||g'`
117
# All curl-config scripts support --feature
118
_libcurl_features=`$_libcurl_config --feature`
121
# All curl-config scripts support --feature
122
_libcurl_features=`$_libcurl_config --feature`
120
124
# Is it modern enough to have --protocols? (7.12.4)
121
if test $_libcurl_version -ge 461828 ; then
125
if test $_libcurl_version -ge 461828 ; then
122
126
_libcurl_protocols=`$_libcurl_config --protocols`
125
129
_libcurl_try_link=no
128
unset _libcurl_wanted
132
unset _libcurl_wanted
131
135
if test $_libcurl_try_link = yes ; then
164
168
if test $libcurl_cv_lib_curl_usable = yes ; then
166
# Does curl_free() exist in this version of libcurl?
167
# If not, fake it with free()
170
# Does curl_free() exist in this version of libcurl?
171
# If not, fake it with free()
169
173
_libcurl_save_cppflags=$CPPFLAGS
170
174
CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"
172
176
LIBS="$LIBS $LIBCURL"
174
178
AC_CHECK_FUNC(curl_free,,
175
AC_DEFINE(curl_free,free,
176
[Define curl_free() as free() if our version of curl lacks curl_free.]))
179
AC_DEFINE(curl_free,free,
180
[Define curl_free() as free() if our version of curl lacks curl_free.]))
178
182
CPPFLAGS=$_libcurl_save_cppflags
179
183
LIBS=$_libcurl_save_libs
186
190
AC_SUBST(LIBCURL)
188
192
for _libcurl_feature in $_libcurl_features ; do
189
AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_feature_$_libcurl_feature),[1])
190
eval AS_TR_SH(libcurl_feature_$_libcurl_feature)=yes
193
if test "x$_libcurl_protocols" = "x" ; then
195
# We don't have --protocols, so just assume that all
196
# protocols are available
197
_libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT"
199
if test x$libcurl_feature_SSL = xyes ; then
200
_libcurl_protocols="$_libcurl_protocols HTTPS"
202
# FTPS wasn't standards-compliant until version
204
if test $_libcurl_version -ge 461568; then
205
_libcurl_protocols="$_libcurl_protocols FTPS"
210
for _libcurl_protocol in $_libcurl_protocols ; do
211
AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_protocol_$_libcurl_protocol),[1])
212
eval AS_TR_SH(libcurl_protocol_$_libcurl_protocol)=yes
216
unset LIBCURL_CPPFLAGS
193
AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_feature_$_libcurl_feature),[1])
194
eval AS_TR_SH(libcurl_feature_$_libcurl_feature)=yes
197
if test "x$_libcurl_protocols" = "x" ; then
199
# We don't have --protocols, so just assume that all
200
# protocols are available
201
_libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT TFTP"
203
if test x$libcurl_feature_SSL = xyes ; then
204
_libcurl_protocols="$_libcurl_protocols HTTPS"
206
# FTPS wasn't standards-compliant until version
207
# 7.11.0 (0x070b00 == 461568)
208
if test $_libcurl_version -ge 461568; then
209
_libcurl_protocols="$_libcurl_protocols FTPS"
213
# RTSP, IMAP, POP3 and SMTP were added in
214
# 7.20.0 (0x071400 == 463872)
215
if test $_libcurl_version -ge 463872; then
216
_libcurl_protocols="$_libcurl_protocols RTSP IMAP POP3 SMTP"
220
for _libcurl_protocol in $_libcurl_protocols ; do
221
AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_protocol_$_libcurl_protocol),[1])
222
eval AS_TR_SH(libcurl_protocol_$_libcurl_protocol)=yes
226
unset LIBCURL_CPPFLAGS