Comments
Patch
@@ -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
When coroutines use GThreads instead of Win32 threads or ucontexts, glib and gthreads must be used. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> --- configure | 39 +++++++++++++++++++++------------------ 1 files changed, 21 insertions(+), 18 deletions(-) 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