curl-library
Re: autoconf Macro & curl-config
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:
#!/bin/sh
ver=`curl-config --vernum | tr 'a-f' 'A-F'`
# check must use uppercase hex letters if any
# the lowest acceptable version
check="070909"
ok=`echo "ibase=16; if($ver>=$check) $ver else 0" | bc`
if [ $ok -gt "0" ]; then
echo "curl version $ver is fine"
else
echo "curl version $ver is too old"
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-10