qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] ui/gtk: require at least GTK 2.18 and VTE 0.26


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] ui/gtk: require at least GTK 2.18 and VTE 0.26
Date: Fri, 22 Feb 2013 09:49:30 -0600
User-agent: Notmuch/0.13.2+93~ged93d79 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu)

"Daniel P. Berrange" <address@hidden> writes:

> On Fri, Feb 22, 2013 at 08:41:42AM -0600, Anthony Liguori wrote:
>> This gives us the bare amount of features we need.  We can add work arounds
>> for older versions and lower the requirement but this should be a good
>> starting point.
>> 
>> Signed-off-by: Anthony Liguori <address@hidden>
>> ---
>>  configure | 45 +++++++++++++++++++++++++++++++++++++++------
>>  1 file changed, 39 insertions(+), 6 deletions(-)
>> 
>> diff --git a/configure b/configure
>> index 0dadd31..259fa7d 100755
>> --- a/configure
>> +++ b/configure
>> @@ -1640,18 +1640,51 @@ if test "$sparse" != "no" ; then
>>    fi
>>  fi
>>  
>> +gtk_check_version()
>> +{
>> +    version="$1"
>> +    major="$2"
>> +    minor="$3"
>> +    release="$4"
>> +
>> +    a=`echo $version | cut -f1 -d.`
>> +    b=`echo $version | cut -f2 -d.`
>> +    c=`echo $version | cut -f3 -d.`
>> +
>> +    if test $a != $major; then
>> +    return 1
>> +    elif test $b -lt $minor; then
>> +    return 1
>> +    elif test $b = $minor -a $c -lt $release; then
>> +    return 1
>> +    fi
>> +
>> +    return 0
>> +}
>> +
>>  ##########################################
>>  # GTK probe
>>  
>>  if test "$gtk" != "no"; then
>>      if $pkg_config gtk+-2.0 --modversion >/dev/null 2>/dev/null && \
>>         $pkg_config vte --modversion >/dev/null 2>/dev/null; then
>> -    gtk_cflags=`$pkg_config --cflags gtk+-2.0 2>/dev/null`
>> -    gtk_libs=`$pkg_config --libs gtk+-2.0 2>/dev/null`
>> -    vte_cflags=`$pkg_config --cflags vte 2>/dev/null`
>> -    vte_libs=`$pkg_config --libs vte 2>/dev/null`
>> -    libs_softmmu="$gtk_libs $vte_libs $libs_softmmu"
>> -    gtk="yes"
>> +    gtk_version=`$pkg_config --modversion gtk+-2.0`
>> +    vte_version=`$pkg_config --modversion vte`
>> +
>> +    if gtk_check_version $gtk_version 2 18 0 &&
>> +        gtk_check_version $vte_version 0 26 0; then
>
>
> Isn't most of this version checking code just re-inventing what
> pkg-config can do for you already
>
>   # pkg-config --exists 'gtk+-2.0 > 2.20.0'
>   # echo $?
>   0
>   # pkg-config --exists 'gtk+-2.0 > 2.50.0'
>   # echo $?
>   1

I didn't know that existed.  Thanks!

Regards,

Anthony Liguori

>
> Regards,
> Daniel
> -- 
> |: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
> |: http://libvirt.org              -o-             http://virt-manager.org :|
> |: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
> |: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




reply via email to

[Prev in Thread] Current Thread [Next in Thread]