Browse files

Enable TSRM to use Pth

  • Loading branch information...
1 parent 80bab9d commit fa1f318d74fc7a944d4644aeb6ea4e87485eca7e Sascha Schumann committed Dec 21, 1999
Showing with 53 additions and 1 deletion.
  1. +53 −1 TSRM/tsrm.m4
View
54 TSRM/tsrm.m4
@@ -10,7 +10,26 @@ AC_CHECK_HEADERS(stdarg.h)
])
-AC_DEFUN(TSRM_PTHREAD,[
+
+AC_DEFUN(TSRM_CHECK_PTH,[
+
+AC_MSG_CHECKING(for GNU Pth)
+PTH_PREFIX="`$1 --prefix`"
+if test -z "$PTH_PREFIX"; then
+ AC_MSG_RESULT(Please check your Pth installation)
+fi
+
+CPPFLAGS="$CPPFLAGS `$1 --cflags`"
+LDFLAGS="$LDFLAGS `$1 --ldflags`"
+LIBS="$LIBS `$1 --libs`"
+
+AC_DEFINE(GNUPTH, 1, [Whether you use GNU Pth])
+AC_MSG_RESULT(yes - installed in $PTH_PREFIX)
+
+])
+
+
+AC_DEFUN(TSRM_CHECK_PTHREADS,[
dnl Check for FreeBSD/Linux -pthread option
@@ -30,4 +49,37 @@ dnl Fall back to the standard -lpthread
fi
AC_DEFINE(PTHREADS, [], Whether to use Pthreads)
+
+AC_MSG_CHECKING(for POSIX threads)
+AC_MSG_RESULT(yes)
+])
+
+
+AC_DEFUN(TSRM_OTHER_CHECKS,[
+
+dnl For the thread implementations, we always use --with-*
+dnl to maintain consistency
+
+AC_ARG_WITH(tsrm-pth,
+[ --with-tsrm-pth[=pth-config] Use GNU Pth.],[
+ TSRM_PTH=$withval
+],[
+ TSRM_PTH=no
+])
+
+AC_ARG_WITH(tsrm-pthreads,
+[ --with-tsrm-pthreads Use POSIX threads (default)],[
+ TSRM_PTHREADS=$withval
+],[
+ TSRM_PTHREADS=yes
+])
+
+test "$TSRM_PTH" = "yes" && TSRM_PTH=pth-config
+
+if test "$TSRM_PTH" != "no"; then
+ TSRM_CHECK_PTH($TSRM_PTH)
+elif test "$TSRM_PTHREADS" != "no"; then
+ TSRM_CHECK_PTHREADS
+fi
+
])

0 comments on commit fa1f318

Please sign in to comment.