diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2010-12-02 16:00:01 +0100 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2010-12-05 18:15:22 +0100 |
commit | a08d433772c1df26fa159be56cb880c5402ed792 (patch) | |
tree | 8ed6bd23381499124609d97812592cb1d7bb0893 /configure.ac | |
parent | a635d450ccbd4bd4c4bc4a1f0a08e2786616f833 (diff) |
gtk: add coroutine utilities
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index 0d3bc48..1a5ff6f 100644 --- a/configure.ac +++ b/configure.ac @@ -142,7 +142,7 @@ AC_SUBST(PULSE_LIBS) # Add parameter for (partial) static linkage of spice client. # this is used to achive single binary package for all (?) distros. AC_ARG_ENABLE(static-linkage, - [ --enable-static-linkage will generate spice client binary with static linkage to external libraries ], + AS_HELP_STRING([--enable-static-linkage], [will generate spice client binary with static linkage to external libraries]), [SPICEC_STATIC_LINKAGE_BSTATIC=["-Wl,-Bstatic"]; SPICEC_STATIC_LINKAGE_BDYNAMIC=["-Wl,-Bdynamic"]]) @@ -173,6 +173,36 @@ AC_SUBST(JPEG_LIBS) AC_CHECK_LIB(z, deflate, Z_LIBS='-lz', AC_MSG_ERROR([zlib not found])) AC_SUBST(Z_LIBS) +WITH_UCONTEXT=1 + +AC_ARG_WITH(coroutine, + AS_HELP_STRING([--with-coroutine=ucontext/gthread], [use ucontext or GThread for coroutines]), + [],[with_coroutine=ucontext]) + +case $with_coroutine in + ucontext) + ;; + gthread) + ;; + *) + AC_MSG_ERROR(Unsupported coroutine type) +esac + +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 + PKG_CHECK_MODULES(GTHREAD, gthread-2.0 > $GTHREAD_REQUIRED) + WITH_UCONTEXT=0 +fi +AC_SUBST(GTHREAD_CFLAGS) +AC_SUBST(GTHREAD_LIBS) +AC_DEFINE_UNQUOTED(WITH_UCONTEXT,[$WITH_UCONTEXT], [Whether to use ucontext coroutine impl]) +AM_CONDITIONAL(WITH_UCONTEXT, [test "$WITH_UCONTEXT" != "0"]) + GOBJECT_INTROSPECTION_CHECK([0.6.7]) PKG_CHECK_MODULES([GOBJECT_INTROSPECTION], [gobject-introspection-1.0 >= 0.9.4], @@ -180,7 +210,7 @@ PKG_CHECK_MODULES([GOBJECT_INTROSPECTION], AM_CONDITIONAL([G_IR_SCANNER_SYMBOL_PREFIX], [test "x$has_symbol_prefix" = "xyes"]) AC_ARG_WITH(python, -[ --with-python build python bindings], + AS_HELP_STRING([--with-python], [build python bindings]), [case "${withval}" in yes|no) ;; *) AC_MSG_ERROR([bad value ${withval} for python option]) ;; @@ -250,7 +280,7 @@ dnl MAYBE_WARN="-Wall -Wno-sign-compare -Werror -Wno-deprecated-declarations" MAYBE_WARN="-Wall -Wno-sign-compare -Wno-deprecated-declarations" AC_ARG_ENABLE(werror, -AC_HELP_STRING([--enable-werror], [Use -Werror (if supported)]), +AS_HELP_STRING([--enable-werror], [Use -Werror (if supported)]), set_werror="$enableval",[ if test -d $srcdir/.git; then is_git_version=true @@ -359,7 +389,7 @@ echo " c compiler: ${CC} c++ compiler: ${CXX} - Red target: ${red_target} + Coroutine: ${with_coroutine} Now type 'make' to build $PACKAGE " |