diff options
author | Alexander Larsson <alexl@redhat.com> | 2010-09-29 13:16:45 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2010-09-29 13:16:45 +0200 |
commit | 44631aa023c58990f13ca50050567033cfa9da3f (patch) | |
tree | 0ce5daa6076b8e9ad2a24d4a69ae6493fa0033be /configure.ac | |
parent | 1670b220b5a60bb957967a5d5424d129cbd909ee (diff) | |
download | spice-44631aa023c58990f13ca50050567033cfa9da3f.tar.gz spice-44631aa023c58990f13ca50050567033cfa9da3f.tar.xz spice-44631aa023c58990f13ca50050567033cfa9da3f.zip |
client: Check for pthread yield function using autoconf
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 3369ddee..76f90711 100644 --- a/configure.ac +++ b/configure.ac @@ -128,6 +128,26 @@ AC_SUBST(LIBRT) SPICE_NONPKGCONFIG_LIBS+=" -pthread $LIBM $LIBRT" +dnl The client needs a yield function +AC_MSG_CHECKING(for posix yield function) +for yield_func in pthread_yield pthread_yield_np sched_yield \ + thr_yield; do + spice_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $SPICE_NONPKGCONFIG_LIBS" + AC_TRY_LINK([#include <pthread.h>], + [$yield_func()], + [posix_yield_func="$yield_func" + break]) + CPPFLAGS="spice_save_CPPFLAGS" +done +if test x"$posix_yield_func" = xnone; then + AC_MSG_ERROR([No posix yield function found]) +else + AC_MSG_RESULT($posix_yield_func) + posix_yield_func="$posix_yield_func()" +fi +AC_DEFINE_UNQUOTED(POSIX_YIELD_FUNC,$posix_yield_func,[The POSIX RT yield function]) + SPICE_REQUIRES="" if test "x$use_gui" = "xyes"; then |