summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorAneesh Kumar K.V2011-06-09 19:41:06 +0200
committerKevin Wolf2011-08-01 12:14:09 +0200
commitd0e2fce5366bff40cf2bf48d2f6ff72b4d8de124 (patch)
tree288ec137a15c408a417e3bf696b548a013f0965c /configure
parentcoroutine: introduce coroutines (diff)
downloadqemu-d0e2fce5366bff40cf2bf48d2f6ff72b4d8de124.tar.gz
qemu-d0e2fce5366bff40cf2bf48d2f6ff72b4d8de124.tar.xz
qemu-d0e2fce5366bff40cf2bf48d2f6ff72b4d8de124.zip
coroutine: implement coroutines using gthread
On platforms that don't support makecontext(3) use gthread based coroutine implementation. Darwin has makecontext(3) but getcontext(3) is stubbed out to return ENOTSUP. Andreas Färber <andreas.faerber@web.de> debugged this and contributed the ./configure test which solves the issue for Darwin/ppc64 (and ppc) v10.5. [Original patch by Aneesh, made consistent with coroutine-ucontext.c and switched to GStaticPrivate by Stefan. Tested on Linux and OpenBSD.] Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure18
1 files changed, 18 insertions, 0 deletions
diff --git a/configure b/configure
index 77194cf9a7..1eed0cd585 100755
--- a/configure
+++ b/configure
@@ -2541,6 +2541,20 @@ 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
@@ -3015,6 +3029,10 @@ if test "$rbd" = "yes" ; then
echo "CONFIG_RBD=y" >> $config_host_mak
fi
+if test "$ucontext_coroutine" = "yes" ; then
+ echo "CONFIG_UCONTEXT_COROUTINE=y" >> $config_host_mak
+fi
+
# USB host support
case "$usb" in
linux)