diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2011-08-12 17:35:39 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2011-08-17 14:44:33 +0200 |
commit | 71fdaa9b3649dc860b6c5e3896cc72d7c9cf68f8 (patch) | |
tree | 58a1c243577d703fdd395190926199b18b86afe2 /configure.ac | |
parent | 1cbfe2b8fccb86a20039867fc33bc475f358f8e4 (diff) | |
download | spice-gtk-71fdaa9b3649dc860b6c5e3896cc72d7c9cf68f8.tar.gz spice-gtk-71fdaa9b3649dc860b6c5e3896cc72d7c9cf68f8.tar.xz spice-gtk-71fdaa9b3649dc860b6c5e3896cc72d7c9cf68f8.zip |
gtk: implement coroutines using Windows fibers
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac index 8c9c5db..e60ed78 100644 --- a/configure.ac +++ b/configure.ac @@ -311,31 +311,49 @@ else fi AC_ARG_WITH([coroutine], - AS_HELP_STRING([--with-coroutine=@<:@ucontext/gthread@:>@], - [use ucontext or GThread for coroutines @<:@default=ucontext@:>@]), + AS_HELP_STRING([--with-coroutine=@<:@ucontext/gthread/winfiber/auto@:>@], + [use ucontext or GThread for coroutines @<:@default=auto@:>@]), [], - [with_coroutine=ucontext]) + [with_coroutine=auto]) case $with_coroutine in - ucontext|gthread) ;; + ucontext|gthread|winfiber|auto) ;; *) AC_MSG_ERROR(Unsupported coroutine type) esac +if test "$with_coroutine" = "auto"; then + if test "$os_win32" = "yes"; then + with_coroutine=winfiber + else + with_coroutine=ucontext + fi +fi + if test "$with_coroutine" = "ucontext"; then AC_CHECK_FUNC(makecontext, [],[with_coroutine=gthread]) AC_CHECK_FUNC(swapcontext, [],[with_coroutine=gthread]) AC_CHECK_FUNC(getcontext, [],[with_coroutine=gthread]) fi -if test "$with_coroutine" = "gthread"; then - # gthread is required anyway - WITH_UCONTEXT=0 -else - WITH_UCONTEXT=1 -fi +WITH_UCONTEXT=0 +WITH_GTHREAD=0 +WITH_WINFIBER=0 + +case $with_coroutine in + ucontext) WITH_UCONTEXT=1 ;; + gthread) WITH_GTHREAD=1 ;; + winfiber) WITH_WINFIBER=1 ;; + *) AC_MSG_ERROR(Unsupported coroutine type) +esac AC_DEFINE_UNQUOTED(WITH_UCONTEXT,[$WITH_UCONTEXT], [Whether to use ucontext coroutine impl]) -AM_CONDITIONAL(WITH_UCONTEXT, [test "$WITH_UCONTEXT" != "0"]) +AM_CONDITIONAL(WITH_UCONTEXT, [test "x$WITH_UCONTEXT" = "x1"]) + +AC_DEFINE_UNQUOTED(WITH_WINFIBER,[$WITH_WINFIBER], [Whether to use fiber coroutine impl]) +AM_CONDITIONAL(WITH_WINFIBER, [test "x$WITH_WINFIBER" = "x1"]) + +AC_DEFINE_UNQUOTED(WITH_GTHREAD,[$WITH_GTHREAD], [Whether to use gthread coroutine impl]) +AM_CONDITIONAL(WITH_GTHREAD, [test "x$WITH_GTHREAD" = "x1"]) AM_CONDITIONAL([HAVE_INTROSPECTION], [test "0" != "1"]) PKG_CHECK_MODULES([GOBJECT_INTROSPECTION], |