David Shaw: Here is the latest libcurl.m4 autoconf tests. It is updated with

the latest features and protocols that libcurl supports and has a minor fix to
better deal with the obscure case where someone has more than one libcurl
installed at the same time.
This commit is contained in:
Daniel Stenberg 2006-01-17 17:39:39 +00:00
parent 394ce9ee39
commit 8971f656b4

View File

@ -1,7 +1,7 @@
# LIBCURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION], # LIBCURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION],
# [ACTION-IF-YES], [ACTION-IF-NO]) # [ACTION-IF-YES], [ACTION-IF-NO])
# ---------------------------------------------------------- # ----------------------------------------------------------
# David Shaw <dshaw@jabberwocky.com> Jun-21-2005 # David Shaw <dshaw@jabberwocky.com> Jan-17-2006
# #
# Checks for libcurl. DEFAULT-ACTION is the string yes or no to # Checks for libcurl. DEFAULT-ACTION is the string yes or no to
# specify whether to default to --with-libcurl or --without-libcurl. # specify whether to default to --with-libcurl or --without-libcurl.
@ -13,10 +13,10 @@
# ACTION-IF-NO is a list of shell commands that are run otherwise. # ACTION-IF-NO is a list of shell commands that are run otherwise.
# Note that using --without-libcurl does run ACTION-IF-NO. # Note that using --without-libcurl does run ACTION-IF-NO.
# #
# This macro defines HAVE_LIBCURL if a working libcurl setup is found, # This macro #defines HAVE_LIBCURL if a working libcurl setup is
# and sets @LIBCURL@ and @LIBCURL_CPPFLAGS@ to the necessary values. # found, and sets @LIBCURL@ and @LIBCURL_CPPFLAGS@ to the necessary
# Other useful defines are LIBCURL_FEATURE_xxx where xxx are the # values. Other useful defines are LIBCURL_FEATURE_xxx where xxx are
# various features supported by libcurl, and LIBCURL_PROTOCOL_yyy # the various features supported by libcurl, and LIBCURL_PROTOCOL_yyy
# where yyy are the various protocols supported by libcurl. Both xxx # where yyy are the various protocols supported by libcurl. Both xxx
# and yyy are capitalized. See the list of AH_TEMPLATEs at the top of # and yyy are capitalized. See the list of AH_TEMPLATEs at the top of
# the macro for the complete list of possible defines. Shell # the macro for the complete list of possible defines. Shell
@ -32,7 +32,8 @@
# found is after version 7.7.2, the first version that included the # found is after version 7.7.2, the first version that included the
# curl-config script. Note that it is very important for people # curl-config script. Note that it is very important for people
# packaging binary versions of libcurl to include this script! # packaging binary versions of libcurl to include this script!
# Without curl-config, we can only guess what protocols are available. # Without curl-config, we can only guess what protocols are available,
# or use curl_version_info to figure it out at runtime.
AC_DEFUN([LIBCURL_CHECK_CONFIG], AC_DEFUN([LIBCURL_CHECK_CONFIG],
[ [
@ -41,6 +42,9 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG],
AH_TEMPLATE([LIBCURL_FEATURE_IPV6],[Defined if libcurl supports IPv6]) AH_TEMPLATE([LIBCURL_FEATURE_IPV6],[Defined if libcurl supports IPv6])
AH_TEMPLATE([LIBCURL_FEATURE_LIBZ],[Defined if libcurl supports libz]) AH_TEMPLATE([LIBCURL_FEATURE_LIBZ],[Defined if libcurl supports libz])
AH_TEMPLATE([LIBCURL_FEATURE_ASYNCHDNS],[Defined if libcurl supports AsynchDNS]) 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_HTTP],[Defined if libcurl supports HTTP])
AH_TEMPLATE([LIBCURL_PROTOCOL_HTTPS],[Defined if libcurl supports HTTPS]) AH_TEMPLATE([LIBCURL_PROTOCOL_HTTPS],[Defined if libcurl supports HTTPS])
@ -50,6 +54,7 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG],
AH_TEMPLATE([LIBCURL_PROTOCOL_TELNET],[Defined if libcurl supports TELNET]) AH_TEMPLATE([LIBCURL_PROTOCOL_TELNET],[Defined if libcurl supports TELNET])
AH_TEMPLATE([LIBCURL_PROTOCOL_LDAP],[Defined if libcurl supports LDAP]) AH_TEMPLATE([LIBCURL_PROTOCOL_LDAP],[Defined if libcurl supports LDAP])
AH_TEMPLATE([LIBCURL_PROTOCOL_DICT],[Defined if libcurl supports DICT]) AH_TEMPLATE([LIBCURL_PROTOCOL_DICT],[Defined if libcurl supports DICT])
AH_TEMPLATE([LIBCURL_PROTOCOL_TFTP],[Defined if libcurl supports TFTP])
AC_ARG_WITH(libcurl, AC_ARG_WITH(libcurl,
AC_HELP_STRING([--with-libcurl=DIR],[look for the curl library in DIR]), AC_HELP_STRING([--with-libcurl=DIR],[look for the curl library in DIR]),
@ -64,12 +69,13 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG],
_libcurl_try_link=yes _libcurl_try_link=yes
if test -d "$_libcurl_with" ; then if test -d "$_libcurl_with" ; then
CPPFLAGS="${CPPFLAGS} -I$withval/include" LIBCURL_CPPFLAGS="-I$withval/include"
LDFLAGS="${LDFLAGS} -L$withval/lib" _libcurl_ldflags="-L$withval/lib"
AC_PATH_PROG([_libcurl_config],["$withval/bin/curl-config"])
else
AC_PATH_PROG([_libcurl_config],[curl-config])
fi fi
AC_PATH_PROG([_libcurl_config],[curl-config])
if test x$_libcurl_config != "x" ; then if test x$_libcurl_config != "x" ; then
AC_CACHE_CHECK([for the version of libcurl], AC_CACHE_CHECK([for the version of libcurl],
[libcurl_cv_lib_curl_version], [libcurl_cv_lib_curl_version],
@ -125,15 +131,15 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG],
# we didn't find curl-config, so let's see if the user-supplied # we didn't find curl-config, so let's see if the user-supplied
# link line (or failing that, "-lcurl") is enough. # link line (or failing that, "-lcurl") is enough.
LIBCURL=${LIBCURL-"-lcurl"} LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"}
AC_CACHE_CHECK([whether libcurl is usable], AC_CACHE_CHECK([whether libcurl is usable],
[libcurl_cv_lib_curl_usable], [libcurl_cv_lib_curl_usable],
[ [
_libcurl_save_cppflags=$CPPFLAGS _libcurl_save_cppflags=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS" CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS"
_libcurl_save_libs=$LIBS _libcurl_save_libs=$LIBS
LIBS="$LIBS $LIBCURL" LIBS="$LIBCURL $LIBS"
AC_LINK_IFELSE(AC_LANG_PROGRAM([#include <curl/curl.h>],[ AC_LINK_IFELSE(AC_LANG_PROGRAM([#include <curl/curl.h>],[
/* Try and use a few common options to force a failure if we are /* Try and use a few common options to force a failure if we are
@ -215,6 +221,7 @@ x=CURLOPT_VERBOSE;
unset _libcurl_protocol unset _libcurl_protocol
unset _libcurl_protocols unset _libcurl_protocols
unset _libcurl_version unset _libcurl_version
unset _libcurl_ldflags
fi fi
if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then