123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276 |
- AC_DEFUN([LIBCURL_CHECK_CONFIG],
- [
- AH_TEMPLATE([LIBCURL_FEATURE_SSL],[Defined if libcurl supports SSL])
- AH_TEMPLATE([LIBCURL_FEATURE_KRB4],[Defined if libcurl supports KRB4])
- AH_TEMPLATE([LIBCURL_FEATURE_IPV6],[Defined if libcurl supports IPv6])
- AH_TEMPLATE([LIBCURL_FEATURE_LIBZ],[Defined if libcurl supports libz])
- AH_TEMPLATE([LIBCURL_FEATURE_ASYNCHDNS],[Defined if libcurl supports AsynchDNS])
- AH_TEMPLATE([LIBCURL_FEATURE_IDN],[Defined if libcurl supports IDN])
- AH_TEMPLATE([LIBCURL_FEATURE_SSPI],[Defined if libcurl supports SSPI])
- AH_TEMPLATE([LIBCURL_FEATURE_NTLM],[Defined if libcurl supports NTLM])
- AH_TEMPLATE([LIBCURL_PROTOCOL_HTTP],[Defined if libcurl supports HTTP])
- AH_TEMPLATE([LIBCURL_PROTOCOL_HTTPS],[Defined if libcurl supports HTTPS])
- AH_TEMPLATE([LIBCURL_PROTOCOL_FTP],[Defined if libcurl supports FTP])
- AH_TEMPLATE([LIBCURL_PROTOCOL_FTPS],[Defined if libcurl supports FTPS])
- AH_TEMPLATE([LIBCURL_PROTOCOL_FILE],[Defined if libcurl supports FILE])
- AH_TEMPLATE([LIBCURL_PROTOCOL_TELNET],[Defined if libcurl supports TELNET])
- AH_TEMPLATE([LIBCURL_PROTOCOL_LDAP],[Defined if libcurl supports LDAP])
- AH_TEMPLATE([LIBCURL_PROTOCOL_DICT],[Defined if libcurl supports DICT])
- AH_TEMPLATE([LIBCURL_PROTOCOL_TFTP],[Defined if libcurl supports TFTP])
- AH_TEMPLATE([LIBCURL_PROTOCOL_RTSP],[Defined if libcurl supports RTSP])
- AH_TEMPLATE([LIBCURL_PROTOCOL_POP3],[Defined if libcurl supports POP3])
- AH_TEMPLATE([LIBCURL_PROTOCOL_IMAP],[Defined if libcurl supports IMAP])
- AH_TEMPLATE([LIBCURL_PROTOCOL_SMTP],[Defined if libcurl supports SMTP])
- AC_ARG_WITH(libcurl,
- AS_HELP_STRING([--with-libcurl=PREFIX],[look for the curl library in PREFIX/lib and headers in PREFIX/include]),
- [_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[yes],[$1])])
- if test "$_libcurl_with" != "no" ; then
- AC_PROG_AWK
- _libcurl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[[1]]+256*A[[2]]+A[[3]]; print X;}'"
- _libcurl_try_link=yes
- if test -d "$_libcurl_with" ; then
- LIBCURL_CPPFLAGS="-I$withval/include"
- _libcurl_ldflags="-L$withval/lib"
- AC_PATH_PROG([_libcurl_config],[curl-config],[],
- ["$withval/bin"])
- else
- AC_PATH_PROG([_libcurl_config],[curl-config],[],[$PATH])
- fi
- if test x$_libcurl_config != "x" ; then
- AC_CACHE_CHECK([for the version of libcurl],
- [libcurl_cv_lib_curl_version],
- [libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $[]2}'`])
- _libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse`
- _libcurl_wanted=`echo ifelse([$2],,[0],[$2]) | $_libcurl_version_parse`
- if test $_libcurl_wanted -gt 0 ; then
- AC_CACHE_CHECK([for libcurl >= version $2],
- [libcurl_cv_lib_version_ok],
- [
- if test $_libcurl_version -ge $_libcurl_wanted ; then
- libcurl_cv_lib_version_ok=yes
- else
- libcurl_cv_lib_version_ok=no
- fi
- ])
- fi
- if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then
- if test x"$LIBCURL_CPPFLAGS" = "x" ; then
- LIBCURL_CPPFLAGS=`$_libcurl_config --cflags`
- fi
- if test x"$LIBCURL" = "x" ; then
- LIBCURL=`$_libcurl_config --libs`
-
-
-
- case "${host}" in
- powerpc-apple-darwin7*)
- LIBCURL=`echo $LIBCURL | sed -e 's|-arch i386||g'`
- ;;
- esac
- fi
-
- _libcurl_features=`$_libcurl_config --feature`
-
- if test $_libcurl_version -ge 461828 ; then
- _libcurl_protocols=`$_libcurl_config --protocols`
- fi
- else
- _libcurl_try_link=no
- fi
- unset _libcurl_wanted
- fi
- if test $_libcurl_try_link = yes ; then
-
-
- LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"}
- AC_CACHE_CHECK([whether libcurl is usable],
- [libcurl_cv_lib_curl_usable],
- [
- _libcurl_save_cppflags=$CPPFLAGS
- CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS"
- _libcurl_save_libs=$LIBS
- LIBS="$LIBCURL $LIBS"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
- /* Try and use a few common options to force a failure if we are
- missing symbols or can't link. */
- int x;
- curl_easy_setopt(NULL,CURLOPT_URL,NULL);
- x=CURL_ERROR_SIZE;
- x=CURLOPT_WRITEFUNCTION;
- x=CURLOPT_WRITEDATA;
- x=CURLOPT_ERRORBUFFER;
- x=CURLOPT_STDERR;
- x=CURLOPT_VERBOSE;
- if (x) {;}
- ]])],libcurl_cv_lib_curl_usable=yes,libcurl_cv_lib_curl_usable=no)
- CPPFLAGS=$_libcurl_save_cppflags
- LIBS=$_libcurl_save_libs
- unset _libcurl_save_cppflags
- unset _libcurl_save_libs
- ])
- if test $libcurl_cv_lib_curl_usable = yes ; then
- # Does curl_free() exist in this version of libcurl?
- # If not, fake it with free()
- _libcurl_save_cppflags=$CPPFLAGS
- CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"
- _libcurl_save_libs=$LIBS
- LIBS="$LIBS $LIBCURL"
- AC_CHECK_DECL([curl_free],[],
- [AC_DEFINE([curl_free],[free],
- [Define curl_free() as free() if our version of curl lacks curl_free.])],
- [[#include <curl/curl.h>]])
- CPPFLAGS=$_libcurl_save_cppflags
- LIBS=$_libcurl_save_libs
- unset _libcurl_save_cppflags
- unset _libcurl_save_libs
- AC_DEFINE(HAVE_LIBCURL,1,
- [Define to 1 if you have a functional curl library.])
- AC_SUBST(LIBCURL_CPPFLAGS)
- AC_SUBST(LIBCURL)
- for _libcurl_feature in $_libcurl_features ; do
- AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_feature_$_libcurl_feature),[1])
- eval AS_TR_SH(libcurl_feature_$_libcurl_feature)=yes
- done
- if test "x$_libcurl_protocols" = "x" ; then
- # We don't have --protocols, so just assume that all
-
- _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT TFTP"
- if test x$libcurl_feature_SSL = xyes ; then
- _libcurl_protocols="$_libcurl_protocols HTTPS"
-
-
- if test $_libcurl_version -ge 461568; then
- _libcurl_protocols="$_libcurl_protocols FTPS"
- fi
- fi
-
-
- if test $_libcurl_version -ge 463872; then
- _libcurl_protocols="$_libcurl_protocols RTSP IMAP POP3 SMTP"
- fi
- fi
- for _libcurl_protocol in $_libcurl_protocols ; do
- AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_protocol_$_libcurl_protocol),[1])
- eval AS_TR_SH(libcurl_protocol_$_libcurl_protocol)=yes
- done
- else
- unset LIBCURL
- unset LIBCURL_CPPFLAGS
- fi
- fi
- unset _libcurl_try_link
- unset _libcurl_version_parse
- unset _libcurl_config
- unset _libcurl_feature
- unset _libcurl_features
- unset _libcurl_protocol
- unset _libcurl_protocols
- unset _libcurl_version
- unset _libcurl_ldflags
- fi
- if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then
-
- ifelse([$4],,:,[$4])
- else
-
- ifelse([$3],,:,[$3])
- fi
- unset _libcurl_with
- ])dnl
|