summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac34
1 files changed, 33 insertions, 1 deletions
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 <tavianator@tavianator.com>
+dnl Copyright (C) 2009-2013 Tavian Barnes <tavianator@tavianator.com>
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 <pthread.h>
+ #include <stdlib.h>
+ ],
+ [
+ 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])