cURL / Mailing Lists / curl-library / Single Mail


Re: autoconf Macro & curl-config

From: Nick Humfrey <>
Date: Thu, 10 Oct 2002 17:40:55 +0100

Thanks Daniel - your email was very helpful.

This probably isn't the best autoconf macro but it works for me.




dnl ******
dnl libcurl
dnl ******

dnl -------
dnl set my_cv_curl_vers to the version of libcurl or NONE
dnl if libcurl is not found or is too old


        if eval curl-config --version 2>/dev/null >/dev/null; then
                ver=`curl-config --version`
                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
                        echo "curl version $ver is fine."
                        echo "curl version $ver is too old. Need
version $check or higher."
        echo "libcurl version ..................................

>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.

This email is sponsored by:ThinkGeek
Welcome to geek heaven.
Received on 2002-10-10