Sync usage with man page.
[netbsd-mini2440.git] / crypto / dist / heimdal / cf / pthreads.m4
blobc9c198ac8bd504c2808b8f2914841b52bfbb1e9a
1 dnl $Heimdal: pthreads.m4 20295 2007-04-11 11:08:08Z lha $
2 dnl $NetBSD$
4 AC_DEFUN([KRB_PTHREADS], [
5 AC_MSG_CHECKING(if compiling threadsafe libraries)
7 AC_ARG_ENABLE(pthread-support,
8         AS_HELP_STRING([--enable-pthread-support],
9                         [if you want thread safe libraries]),
10         [],[enable_pthread_support=maybe])
12 case "$host" in 
13 *-*-solaris2*)
14         native_pthread_support=yes
15         if test "$GCC" = yes; then
16                 PTHREADS_CFLAGS=-pthreads
17                 PTHREADS_LIBS=-pthreads
18         else
19                 PTHREADS_CFLAGS=-mt
20                 PTHREADS_LIBS=-mt
21         fi
22         ;;
23 *-*-netbsd*)
24         native_pthread_support="if running netbsd 1.6T or newer"
25         dnl heim_threads.h knows this
26         PTHREADS_LIBS=""
27         ;;
28 *-*-freebsd5*)
29         native_pthread_support=yes
30         ;;
31 *-*-linux* | *-*-linux-gnu)
32         case `uname -r` in
33         2.*)
34                 native_pthread_support=yes
35                 PTHREADS_CFLAGS=-pthread
36                 PTHREADS_LIBS=-pthread
37                 ;;
38         esac
39         ;;
40 *-*-aix*)
41         dnl AIX is disabled since we don't handle the utmp/utmpx
42         dnl problems that aix causes when compiling with pthread support
43         native_pthread_support=no
44         ;;
45 mips-sgi-irix6.[[5-9]])  # maybe works for earlier versions too
46         native_pthread_support=yes
47         PTHREADS_LIBS="-lpthread"
48         ;;
49 *-*-darwin*)
50         native_pthread_support=yes
51         ;;
53         native_pthread_support=no
54         ;;
55 esac
57 if test "$enable_pthread_support" = maybe ; then
58         enable_pthread_support="$native_pthread_support"
60         
61 if test "$enable_pthread_support" != no; then
62     AC_DEFINE(ENABLE_PTHREAD_SUPPORT, 1,
63         [Define if you want have a thread safe libraries])
64     dnl This sucks, but libtool doesn't save the depenecy on -pthread
65     dnl for libraries.
66     LIBS="$PTHREADS_LIBS $LIBS"
67 else
68   PTHREADS_CFLAGS=""
69   PTHREADS_LIBS=""
72 AC_SUBST(PTHREADS_CFLAGS)
73 AC_SUBST(PTHREADS_LIBS)
75 AC_MSG_RESULT($enable_pthread_support)