cURL / Mailing Lists / curl-library / Single Mail


Re: autoconf Macro & curl-config

From: Daniel Stenberg <>
Date: Thu, 10 Oct 2002 16:13:40 +0200 (MET DST)

On Thu, 10 Oct 2002, Nick Humfrey wrote:

> Does anyone have an autoconf Macro to check for the presence/version of
> libcurl ?
> I am adding curl support to OpenQuicktime. I am using the Multi features of
> curl and would like to check to make sure they have version 7.9.7 or later
> installed...
> Should just be a matter of comparing the hex version number - but I am not
> sure of a good way of doing that... ?

Without doing a very extensive test, I wrote up this little check that seems
to work for me on Solaris and Linux at least. It is a bourne shell script,
that uses tr and bc:

ver=`curl-config --vernum | tr 'a-f' 'A-F'`

# check must use uppercase hex letters if any
# the lowest acceptable version

ok=`echo "ibase=16; if($ver>=$check) $ver else 0" | bc`

if [ $ok -gt "0" ]; then
  echo "curl version $ver is fine"
  echo "curl version $ver is too old"

 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
This email is sponsored by:ThinkGeek
Welcome to geek heaven.
Received on 2002-10-10