diff mbox

configure: require glib 2.12, 2.20 for mingw32

Message ID 1333623714-12688-1-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini April 5, 2012, 11:01 a.m. UTC
These are pretty sane requirements to move forward with glib usage.
2.12 is the version found in RHEL/CentOS 5, and 2.20 is the
first version to support g_poll.  Without g_poll, we cannot
integrate well with the glib main loop.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Blue Swirl April 7, 2012, 2:14 p.m. UTC | #1
On Thu, Apr 5, 2012 at 11:01, Paolo Bonzini <pbonzini@redhat.com> wrote:
> These are pretty sane requirements to move forward with glib usage.
> 2.12 is the version found in RHEL/CentOS 5, and 2.20 is the
> first version to support g_poll.  Without g_poll, we cannot
> integrate well with the glib main loop.

It looks like 2.20 was released in 2009, so for win32 this is reasonable too.

Thanks, applied.

>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  configure |   12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/configure b/configure
> index 4b3adc9..6f850a6 100755
> --- a/configure
> +++ b/configure
> @@ -1993,13 +1993,21 @@ fi
>
>  ##########################################
>  # glib support probe
> -if $pkg_config --modversion gthread-2.0 > /dev/null 2>&1 ; then
> +
> +if test "$mingw32" = yes; then
> +    # g_poll is required in order to integrate with the glib main loop.
> +    glib_req_ver=2.20
> +else
> +    glib_req_ver=2.12
> +fi
> +if $pkg_config --atleast-version=$glib_req_ver gthread-2.0 > /dev/null 2>&1
> +then
>     glib_cflags=`$pkg_config --cflags gthread-2.0 2>/dev/null`
>     glib_libs=`$pkg_config --libs gthread-2.0 2>/dev/null`
>     LIBS="$glib_libs $LIBS"
>     libs_qga="$glib_libs $libs_qga"
>  else
> -    echo "glib-2.0 required to compile QEMU"
> +    echo "glib-$glib_req_ver required to compile QEMU"
>     exit 1
>  fi
>
> --
> 1.7.9.3
>
Gerd Hoffmann April 16, 2012, 11:08 a.m. UTC | #2
On 04/05/12 13:01, Paolo Bonzini wrote:
> These are pretty sane requirements to move forward with glib usage.
> 2.12 is the version found in RHEL/CentOS 5, and 2.20 is the
> first version to support g_poll.  Without g_poll, we cannot
> integrate well with the glib main loop.

We have a glib-related rhel5 build failure though:

  CC    qapi/qmp-input-visitor.o
qapi/qmp-input-visitor.c: In function ‘qmp_input_pop’:
qapi/qmp-input-visitor.c:92: error: ‘GHashTableIter’ undeclared (first
use in this function)
qapi/qmp-input-visitor.c:92: error: (Each undeclared identifier is
reported only once
qapi/qmp-input-visitor.c:92: error: for each function it appears in.)
qapi/qmp-input-visitor.c:92: error: expected ‘;’ before ‘iter’
cc1: warnings being treated as errors
qapi/qmp-input-visitor.c:96: warning: implicit declaration of function
‘g_hash_table_iter_init’
qapi/qmp-input-visitor.c:96: warning: nested extern declaration of
‘g_hash_table_iter_init’
qapi/qmp-input-visitor.c:96: error: ‘iter’ undeclared (first use in this
function)
qapi/qmp-input-visitor.c:97: warning: implicit declaration of function
‘g_hash_table_iter_next’
qapi/qmp-input-visitor.c:97: warning: nested extern declaration of
‘g_hash_table_iter_next’
make: *** [qapi/qmp-input-visitor.o] Error 1

Guess 2.12 just hasn't hash tables yet, so we have to figure whenever we
want raise the minimum glib version or stop using glib hash tables.

cheers,
  Gerd
Peter Maydell April 16, 2012, 11:10 a.m. UTC | #3
On 16 April 2012 12:08, Gerd Hoffmann <kraxel@redhat.com> wrote:
> On 04/05/12 13:01, Paolo Bonzini wrote:
>> These are pretty sane requirements to move forward with glib usage.
>> 2.12 is the version found in RHEL/CentOS 5, and 2.20 is the
>> first version to support g_poll.  Without g_poll, we cannot
>> integrate well with the glib main loop.
>
> We have a glib-related rhel5 build failure though:
>
>  CC    qapi/qmp-input-visitor.o
> qapi/qmp-input-visitor.c: In function ‘qmp_input_pop’:
> qapi/qmp-input-visitor.c:92: error: ‘GHashTableIter’ undeclared (first
> use in this function)

There's been a patch for this posted just recently:
 http://patchwork.ozlabs.org/patch/152328/

-- PMM
Daniel P. Berrangé April 16, 2012, 11:11 a.m. UTC | #4
On Mon, Apr 16, 2012 at 01:08:01PM +0200, Gerd Hoffmann wrote:
> On 04/05/12 13:01, Paolo Bonzini wrote:
> > These are pretty sane requirements to move forward with glib usage.
> > 2.12 is the version found in RHEL/CentOS 5, and 2.20 is the
> > first version to support g_poll.  Without g_poll, we cannot
> > integrate well with the glib main loop.
> 
> We have a glib-related rhel5 build failure though:
> 
>   CC    qapi/qmp-input-visitor.o
> qapi/qmp-input-visitor.c: In function ‘qmp_input_pop’:
> qapi/qmp-input-visitor.c:92: error: ‘GHashTableIter’ undeclared (first
> use in this function)
> qapi/qmp-input-visitor.c:92: error: (Each undeclared identifier is
> reported only once
> qapi/qmp-input-visitor.c:92: error: for each function it appears in.)
> qapi/qmp-input-visitor.c:92: error: expected ‘;’ before ‘iter’
> cc1: warnings being treated as errors
> qapi/qmp-input-visitor.c:96: warning: implicit declaration of function
> ‘g_hash_table_iter_init’
> qapi/qmp-input-visitor.c:96: warning: nested extern declaration of
> ‘g_hash_table_iter_init’
> qapi/qmp-input-visitor.c:96: error: ‘iter’ undeclared (first use in this
> function)
> qapi/qmp-input-visitor.c:97: warning: implicit declaration of function
> ‘g_hash_table_iter_next’
> qapi/qmp-input-visitor.c:97: warning: nested extern declaration of
> ‘g_hash_table_iter_next’
> make: *** [qapi/qmp-input-visitor.o] Error 1
> 
> Guess 2.12 just hasn't hash tables yet, so we have to figure whenever we
> want raise the minimum glib version or stop using glib hash tables.

Only the use of iterators is a problem and there was a patch posted for
that:

http://lists.nongnu.org/archive/html/qemu-devel/2012-04/msg01623.html

Daniel
diff mbox

Patch

diff --git a/configure b/configure
index 4b3adc9..6f850a6 100755
--- a/configure
+++ b/configure
@@ -1993,13 +1993,21 @@  fi
 
 ##########################################
 # glib support probe
-if $pkg_config --modversion gthread-2.0 > /dev/null 2>&1 ; then
+
+if test "$mingw32" = yes; then
+    # g_poll is required in order to integrate with the glib main loop.
+    glib_req_ver=2.20
+else
+    glib_req_ver=2.12
+fi
+if $pkg_config --atleast-version=$glib_req_ver gthread-2.0 > /dev/null 2>&1
+then
     glib_cflags=`$pkg_config --cflags gthread-2.0 2>/dev/null`
     glib_libs=`$pkg_config --libs gthread-2.0 2>/dev/null`
     LIBS="$glib_libs $LIBS"
     libs_qga="$glib_libs $libs_qga"
 else
-    echo "glib-2.0 required to compile QEMU"
+    echo "glib-$glib_req_ver required to compile QEMU"
     exit 1
 fi