2018-07-26 23:12:07 +08:00
|
|
|
m4_include([TSRM/m4/ax_func_which_gethostbyname_r.m4])
|
1999-12-30 10:19:39 +08:00
|
|
|
|
2004-12-30 15:08:39 +08:00
|
|
|
AC_DEFUN([TSRM_BASIC_CHECKS],[
|
1999-12-17 21:36:15 +08:00
|
|
|
|
|
|
|
AC_REQUIRE([AC_PROG_CC])dnl
|
|
|
|
dnl AC_REQUIRE([AM_PROG_CC_STDC])dnl
|
|
|
|
AC_REQUIRE([AC_PROG_RANLIB])dnl
|
|
|
|
|
2011-06-03 05:16:50 +08:00
|
|
|
AC_CHECK_FUNCS(sigprocmask)
|
|
|
|
|
2016-03-31 19:39:01 +08:00
|
|
|
AX_FUNC_WHICH_GETHOSTBYNAME_R()
|
|
|
|
|
1999-12-17 21:36:15 +08:00
|
|
|
])
|
|
|
|
|
1999-12-22 02:03:35 +08:00
|
|
|
|
2004-12-30 15:08:39 +08:00
|
|
|
AC_DEFUN([TSRM_CHECK_PTH],[
|
1999-12-22 02:03:35 +08:00
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
])
|
|
|
|
|
2004-12-30 15:08:39 +08:00
|
|
|
AC_DEFUN([TSRM_CHECK_ST],[
|
2001-06-22 00:54:05 +08:00
|
|
|
if test -r "$1/include/st.h"; then
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$1/include"
|
|
|
|
LDFLAGS="$LDFLAGS -L$1/lib"
|
|
|
|
elif test -r "$1/st.h"; then
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$1"
|
|
|
|
LDFLAGS="$LDFLAGS -L$1"
|
|
|
|
fi
|
2001-08-21 19:00:22 +08:00
|
|
|
AC_CHECK_HEADERS(st.h,[],[
|
2001-06-22 00:54:05 +08:00
|
|
|
AC_MSG_ERROR([Sorry[,] I was unable to locate the State Threads header file. Please specify the prefix using --with-tsrm-st=/prefix])
|
|
|
|
])
|
|
|
|
LIBS="$LIBS -lst"
|
|
|
|
AC_MSG_CHECKING(for SGI's State Threads)
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(TSRM_ST, 1, [ ])
|
|
|
|
])
|
|
|
|
|
2000-03-07 21:24:12 +08:00
|
|
|
sinclude(threads.m4)
|
2000-03-08 00:49:17 +08:00
|
|
|
|
2004-12-30 15:08:39 +08:00
|
|
|
AC_DEFUN([TSRM_CHECK_PTHREADS],[
|
2018-07-29 09:53:52 +08:00
|
|
|
|
2000-03-07 21:24:12 +08:00
|
|
|
PTHREADS_CHECK
|
2018-07-29 09:53:52 +08:00
|
|
|
|
2017-08-30 04:03:56 +08:00
|
|
|
if test "$pthreads_working" != "yes"; then
|
|
|
|
AC_MSG_ERROR(Your system seems to lack POSIX threads.)
|
|
|
|
fi
|
1999-12-22 02:03:35 +08:00
|
|
|
|
2017-08-30 04:03:56 +08:00
|
|
|
AC_DEFINE(PTHREADS, 1, Whether to use Pthreads)
|
2002-10-05 19:26:17 +08:00
|
|
|
|
2017-08-30 04:03:56 +08:00
|
|
|
AC_MSG_CHECKING(for POSIX threads)
|
|
|
|
AC_MSG_RESULT(yes)
|
1999-12-22 02:03:35 +08:00
|
|
|
])
|
|
|
|
|
2004-12-30 15:08:39 +08:00
|
|
|
AC_DEFUN([TSRM_THREADS_CHECKS],[
|
1999-12-22 02:03:35 +08:00
|
|
|
|
|
|
|
dnl For the thread implementations, we always use --with-*
|
|
|
|
dnl to maintain consistency
|
|
|
|
|
|
|
|
AC_ARG_WITH(tsrm-pth,
|
2003-10-03 13:24:33 +08:00
|
|
|
[ --with-tsrm-pth[=pth-config]
|
2005-05-30 07:17:16 +08:00
|
|
|
Use GNU Pth],[
|
1999-12-22 02:03:35 +08:00
|
|
|
TSRM_PTH=$withval
|
|
|
|
],[
|
|
|
|
TSRM_PTH=no
|
|
|
|
])
|
|
|
|
|
2001-06-22 00:54:05 +08:00
|
|
|
AC_ARG_WITH(tsrm-st,
|
2003-10-03 13:24:33 +08:00
|
|
|
[ --with-tsrm-st Use SGI's State Threads],[
|
2001-06-22 00:54:05 +08:00
|
|
|
TSRM_ST=$withval
|
|
|
|
],[
|
|
|
|
TSRM_ST=no
|
|
|
|
])
|
|
|
|
|
1999-12-22 02:03:35 +08:00
|
|
|
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)
|
2001-06-22 00:54:05 +08:00
|
|
|
elif test "$TSRM_ST" != "no"; then
|
|
|
|
TSRM_CHECK_ST($TSRM_ST)
|
1999-12-22 02:03:35 +08:00
|
|
|
elif test "$TSRM_PTHREADS" != "no"; then
|
|
|
|
TSRM_CHECK_PTHREADS
|
|
|
|
fi
|
|
|
|
|
1999-12-17 21:36:15 +08:00
|
|
|
])
|