curl-library
Re: autoconf Macro & curl-config
Date: Fri, 11 Oct 2002 10:32:59 +0200 (MET DST)
On Thu, 10 Oct 2002, Nick Humfrey wrote:
> This probably isn't the best autoconf macro but it works for me.
Ok, looked fine enough. I would however use a little more traditional
autoconf'isms in it, so it would make something like this:
dnl MY_CURL
dnl -------
dnl set my_cv_curl_vers to the version of libcurl or NONE
dnl if libcurl is not found or is too old
AC_DEFUN(MY_CURL,[
AC_CACHE_VAL(my_cv_curl_vers,[
my_cv_curl_vers=NONE
check="7.9.7"
check_hex="070907"
AC_MSG_CHECKING([for curl >= $check])
if eval curl-config --version 2>/dev/null >/dev/null; then
ver=`curl-config --version | sed -e "s/libcurl //g"`
hex_ver=`curl-config --vernum | tr 'a-f' 'A-F'`
ok=`echo "ibase=16; if($hex_ver>=$check_hex) $hex_ver else 0" | bc`
if test x$ok != x0; then
my_cv_curl_vers="$ver"
AC_MSG_RESULT([$my_cv_curl_vers])
else
AC_MSG_RESULT(FAILED)
AC_MSG_WARN([$ver is too old. Need version $check or higher.])
fi
else
AC_MSG_RESULT(FAILED)
AC_MSG_WARN([curl-config was not found])
fi
])
])
-- Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs. ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sfReceived on 2002-10-11