diff options
author | Ryan C. Gordon <icculus@icculus.org> | 2011-09-21 03:08:00 -0400 |
---|---|---|
committer | Ryan C. Gordon <icculus@icculus.org> | 2011-09-21 03:08:00 -0400 |
commit | d2102414902a0178f65fd1219a60dc671ce35da8 (patch) | |
tree | ecff816735e9c08e5070aee8573e42a4674f5904 /configure.in | |
parent | 3d82ba26dd1c6e13d9014fb48057a88e15fd5962 (diff) |
Moved pthread spinlock check in with the rest of the pthread tests.
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/configure.in b/configure.in index 7a180490..4f85cc4f 100644 --- a/configure.in +++ b/configure.in @@ -277,25 +277,6 @@ if test x$enable_gcc_atomics = xyes; then fi fi -# Check for pthread implementation -AC_MSG_CHECKING(for pthread spinlock) -have_pthread_spinlock=no - -AC_TRY_LINK([ -#include <pthread.h> -],[ -pthread_spinlock_t a; -pthread_spin_trylock(&a); -pthread_spin_unlock(&a); -],[ -have_pthread_spinlock=yes -]) -AC_MSG_RESULT($have_pthread_spinlock) -if test x$have_pthread_spinlock = xyes; then - AC_DEFINE(HAVE_PTHREAD_SPINLOCK, 1, [ ]) -fi - - # Standard C sources SOURCES="$SOURCES $srcdir/src/*.c" SOURCES="$SOURCES $srcdir/src/atomic/*.c" @@ -1652,6 +1633,15 @@ AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]) AC_MSG_RESULT($have_pthread_sem) fi + AC_MSG_CHECKING(for pthread_spin_trylock) + AC_TRY_LINK_FUNC(pthread_spin_trylock, [ + has_pthread_spin_trylock=yes + AC_DEFINE(HAVE_PTHREAD_SPINLOCK, 1, [ ]) + ],[ + has_pthread_spin_trylock=no + ]) + AC_MSG_RESULT($has_pthread_spin_trylock) + # Restore the compiler flags and libraries CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs" |