qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] Fix build failure when coroutines need gthreads but


From: Blue Swirl
Subject: [Qemu-devel] [PATCH] Fix build failure when coroutines need gthreads but guest agent is disabled
Date: Sun, 7 Aug 2011 09:29:13 +0000

When coroutines use GThreads instead of Win32 threads or ucontexts,
glib and gthreads must be used.

Signed-off-by: Blue Swirl <address@hidden>
---
 configure |   39 +++++++++++++++++++++------------------
 1 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/configure b/configure
index 0c67a4a..a25e65c 100755
--- a/configure
+++ b/configure
@@ -1843,15 +1843,32 @@ EOF
 fi

 ##########################################
+# check if we have makecontext
+
+ucontext_coroutine=no
+if test "$darwin" != "yes"; then
+  cat > $TMPC << EOF
+#include <ucontext.h>
+int main(void) { makecontext(0, 0, 0); }
+EOF
+  if compile_prog "" "" ; then
+      ucontext_coroutine=yes
+  fi
+fi
+
+##########################################
 # glib support probe
-if test "$guest_agent" != "no" ; then
+if test "$guest_agent" != "no" -o "$ucontext_coroutine" != "yes" -a
"$mingw32" != "yes"; then
     if $pkg_config --modversion glib-2.0 > /dev/null 2>&1 ; then
         glib_cflags=`$pkg_config --cflags glib-2.0 2>/dev/null`
         glib_libs=`$pkg_config --libs glib-2.0 2>/dev/null`
-        libs_softmmu="$glib_libs $libs_softmmu"
-        libs_tools="$glib_libs $libs_tools"
+        gthread_cflags=`$pkg_config --cflags gthread-2.0 2>/dev/null`
+        gthread_libs=`$pkg_config --libs gthread-2.0 2>/dev/null`
+        glib_cflags="$glib_cflags $gthread_cflags"
+        libs_softmmu="$glib_libs $gthread_libs $libs_softmmu"
+        libs_tools="$glib_libs $gthread_libs $libs_tools"
     else
-        echo "glib-2.0 required to compile QEMU"
+        echo "glib-2.0 required to compile QEMU with guest agent or
gthread based coroutines"
         exit 1
     fi
 fi
@@ -2557,20 +2574,6 @@ EOF
 fi

 ##########################################
-# check if we have makecontext
-
-ucontext_coroutine=no
-if test "$darwin" != "yes"; then
-  cat > $TMPC << EOF
-#include <ucontext.h>
-int main(void) { makecontext(0, 0, 0); }
-EOF
-  if compile_prog "" "" ; then
-      ucontext_coroutine=yes
-  fi
-fi
-
-##########################################
 # End of CC checks
 # After here, no more $cc or $ld runs

-- 
1.6.2.4



reply via email to

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