1999-12-30 10:19:39 +08:00
|
|
|
|
|
|
|
dnl TSRM_CHECK_GCC_ARG(ARG, ACTION-IF-FOUND, ACTION-IF-NOT_FOUND)
|
1999-12-23 06:23:06 +08:00
|
|
|
AC_DEFUN(TSRM_CHECK_GCC_ARG,[
|
1999-12-30 10:19:39 +08:00
|
|
|
gcc_arg_name=[ac_cv_gcc_arg]translit($1,A-Z-,a-z_)
|
|
|
|
AC_CACHE_CHECK([whether $CC supports $1], [ac_cv_gcc_arg]translit($1,A-Z-,a-z_), [
|
|
|
|
echo 'void somefunc() { };' > conftest.c
|
1999-12-23 06:23:06 +08:00
|
|
|
cmd='$CC $1 -c conftest.c'
|
|
|
|
if eval $cmd 2>&1 | egrep -e $1 >/dev/null ; then
|
1999-12-30 10:19:39 +08:00
|
|
|
ac_result=no
|
1999-12-23 06:23:06 +08:00
|
|
|
else
|
1999-12-30 10:19:39 +08:00
|
|
|
ac_result=yes
|
1999-12-23 06:23:06 +08:00
|
|
|
fi
|
1999-12-30 10:19:39 +08:00
|
|
|
eval $gcc_arg_name=$ac_result
|
1999-12-23 06:23:06 +08:00
|
|
|
rm -f conftest.*
|
1999-12-30 10:19:39 +08:00
|
|
|
])
|
|
|
|
if eval test "\$$gcc_arg_name" = "yes"; then
|
|
|
|
$2
|
|
|
|
else
|
|
|
|
:
|
|
|
|
$3
|
|
|
|
fi
|
1999-12-23 06:23:06 +08:00
|
|
|
])
|
1999-12-17 21:36:15 +08:00
|
|
|
|
|
|
|
AC_DEFUN(TSRM_BASIC_CHECKS,[
|
|
|
|
|
|
|
|
AC_REQUIRE([AC_PROG_CC])dnl
|
|
|
|
dnl AC_REQUIRE([AM_PROG_CC_STDC])dnl
|
|
|
|
AC_REQUIRE([AC_PROG_CC_C_O])dnl
|
|
|
|
AC_REQUIRE([AC_PROG_RANLIB])dnl
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS(stdarg.h)
|
|
|
|
|
|
|
|
])
|
|
|
|
|
1999-12-22 02:03:35 +08:00
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
])
|
|
|
|
|
2000-03-07 21:24:12 +08:00
|
|
|
sinclude(threads.m4)
|
|
|
|
sinclude(TSRM/threads.m4)
|
2000-03-08 00:49:17 +08:00
|
|
|
|
|
|
|
AC_DEFUN(TSRM_CHECK_PTHREADS,[
|
2000-03-07 21:24:12 +08:00
|
|
|
|
|
|
|
PTHREADS_CHECK
|
|
|
|
|
|
|
|
if test "$pthreads_working" != "yes"; then
|
|
|
|
AC_MSG_ERROR(Your system seems to lack POSIX threads.)
|
1999-12-17 21:36:15 +08:00
|
|
|
fi
|
1999-12-22 00:29:30 +08:00
|
|
|
|
1999-12-30 08:48:45 +08:00
|
|
|
AC_DEFINE(PTHREADS, 1, Whether to use Pthreads)
|
1999-12-22 02:03:35 +08:00
|
|
|
|
|
|
|
AC_MSG_CHECKING(for POSIX threads)
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
])
|
|
|
|
|
|
|
|
|
2000-09-02 23:24:18 +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,
|
|
|
|
[ --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
|
|
|
|
|
1999-12-17 21:36:15 +08:00
|
|
|
])
|