summaryrefslogtreecommitdiff
path: root/TSRM
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>1999-12-21 18:03:35 +0000
committerSascha Schumann <sas@php.net>1999-12-21 18:03:35 +0000
commitfa1f318d74fc7a944d4644aeb6ea4e87485eca7e (patch)
tree32dd14ede19d6a44c60afe1b9ea359793ef14aba /TSRM
parent80bab9d9394939c43e61300621aa7c72ab901ef7 (diff)
downloadphp-git-fa1f318d74fc7a944d4644aeb6ea4e87485eca7e.tar.gz
Enable TSRM to use Pth
Diffstat (limited to 'TSRM')
-rw-r--r--TSRM/tsrm.m454
1 files changed, 53 insertions, 1 deletions
diff --git a/TSRM/tsrm.m4 b/TSRM/tsrm.m4
index ca7a0e1066..1523c58f48 100644
--- a/TSRM/tsrm.m4
+++ b/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
+
])