1 #@synonpsis RSSH_CHECK_PTHREADS
2 # check for pthreads system interfaces.
3 # set CFLAGS_PTHREADS, CXXFLAGS_PTHREADS and LIBS_PTHREADS to
4 # flags to compiler option, which denote multithread program compilation
6 # and multithread library, if one required.
8 #@author (C) Ruslan Shevchenko <Ruslan@Shevchenko.Kiev.UA>, 1998
9 #@id $Id: RSSH_CHECK_PTHREADS.m4,v 1.6 2001/05/07 19:21:22 rssh Exp $
11 AC_DEFUN([RSSH_CHECK_PTHREADS],[
12 dnl AC_REQUIRE([RSSH_CHECK_SUNPRO_C])dnl
13 AC_REQUIRE([RSSH_CHECK_SUNPRO_CC])dnl
14 AC_CHECK_HEADER(pthread.h,AC_DEFINE(HAVE_PTHREAD_H,1,If pthreads are present))
15 if test x$rssh_cv_check_sunpro_c = xyes
19 if test x$rssh_cv_check_sunpro_cc = xyes
21 CXXFLAGS_PTHREADS="-mt"
25 CFLAGS_PTHREADS="-pthread"
26 CXXFLAGS_PTHREADS="-pthread"
33 if test x$freebsd_pthreads = xno
35 AC_CHECK_LIB(pthread,pthread_create, LIBS_PTHREADS="-lpthread")
37 AC_CHECK_LIB(posix4,nanosleep, LIBS_PTHREADS="$LIBS_PTHREADS -lposix4")