Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Enable TSRM to use Pth
  • Loading branch information
Sascha Schumann committed Dec 21, 1999
1 parent 80bab9d commit fa1f318
Showing 1 changed file with 53 additions and 1 deletion.
54 changes: 53 additions & 1 deletion TSRM/tsrm.m4
Expand Up @@ -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
Expand All @@ -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.