From c324c3a9e7558e87ec628d45d3d0577d614ee350 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 22 Mar 2013 21:41:45 -0400 Subject: Use spinlock for futures when possible. --- configure.ac | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 1141ac8..8faf2bb 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -dnl Copyright (C) 2009-2012 Tavian Barnes +dnl Copyright (C) 2009-2013 Tavian Barnes dnl dnl This file is part of The Dimension Build Suite. dnl @@ -231,6 +231,38 @@ AC_COMPILE_IFELSE([ AC_MSG_RESULT([no])] ) +save_CFLAGS="$CFLAGS" +save_LIBS="$LIBS" +CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +LIBS="$LIBS $PTHREAD_LIBS" +AC_MSG_CHECKING([for pthread_spinlock_t]) +AC_RUN_IFELSE([ + AC_LANG_PROGRAM( + [ + #include + #include + ], + [ + pthread_spinlock_t spinlock; + if (pthread_spin_init(&spinlock, PTHREAD_PROCESS_PRIVATE) != 0) { + return EXIT_FAILURE; + } + if (pthread_spin_lock(&spinlock) != 0) { + return EXIT_FAILURE; + } + if (pthread_spin_unlock(&spinlock) != 0) { + return EXIT_FAILURE; + } + ] + )], + [AC_DEFINE([DMNSN_SPINLOCK], [1]) + AC_MSG_RESULT([yes])], + [AC_DEFINE([DMNSN_SPINLOCK], [0]) + AC_MSG_RESULT([no])] +) +CFLAGS="$save_CFLAGS" +LIBS="$save_LIBS" + AC_CHECK_HEADER([GL/glx.h], [have_glx=yes], [have_glx=no]) if test "$enable_gl" = "yes" -a "$have_glx" = "yes"; then AC_CHECK_LIB([X11], [XOpenDisplay], [], [have_glx=no]) -- cgit v1.2.3