* update the changelog
[tango.git] / config / RSSH_CHECK_PTHREADS.m4
blobe46ea67d4f959c28f5ac696c5283af11db3ce82b
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 
5 # (if one exists),
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
16 then
17   CFLAGS_PTHREADS="-mt"
19 if test x$rssh_cv_check_sunpro_cc = xyes
20 then
21   CXXFLAGS_PTHREADS="-mt"
23 case $build_os in
24   freebsd*)
25     CFLAGS_PTHREADS="-pthread"
26     CXXFLAGS_PTHREADS="-pthread"
27     freebsd_pthreads=yes
28     ;;
29   *)
30     freebsd_pthreads=no
31     ;;
32 esac
33 if test x$freebsd_pthreads = xno
34 then
35   AC_CHECK_LIB(pthread,pthread_create, LIBS_PTHREADS="-lpthread")
37 AC_CHECK_LIB(posix4,nanosleep, LIBS_PTHREADS="$LIBS_PTHREADS -lposix4")
38 ])dnl