[gnome-games] glchess: check for pthread if building gnuchess



commit 1d6e58b0f2e160e785a92249e55f92976c5fa062
Author: Thomas Hindoe Paaboel Andersen <phomes gmail com>
Date:   Thu Oct 15 23:32:58 2009 +0200

    glchess: check for pthread if building gnuchess

 configure.in |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/configure.in b/configure.in
index afaa230..a80e67a 100644
--- a/configure.in
+++ b/configure.in
@@ -895,6 +895,17 @@ if test "$allow_gnuchess" = "yes"; then
 
   if test "$enable_gnuchess" = "yes"; then
     AC_DEFINE([ENABLE_GNUCHESS],[1],[Enable compilation of included GNU Chess as AI chess engine for glChess])
+    AC_CHECK_HEADER(pthread.h, [],
+                  AC_MSG_ERROR([*** Cannot find pthread.h header]))
+    AC_CHECK_LIB(pthread, pthread_create,
+                 [PTHREAD_LDFLAGS="$PTHREAD_LDFLAGS -lpthread"
+                  PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT"],
+                 [AC_CHECK_LIB(c_r, pthread_create,
+                               [PTHREAD_LDFLAGS="$PTHREAD_LDFLAGS -pthread"
+                                PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE"],
+                 AC_MSG_ERROR([*** Cannot find pthread library]))])
+    AC_SUBST(PTHREAD_CFLAGS)
+    AC_SUBST(PTHREAD_LDFLAGS)
   fi
 fi
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]