1 dnl $Heimdal: pthreads.m4 20295 2007-04-11 11:08:08Z lha $
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])
14 native_pthread_support=yes
15 if test "$GCC" = yes; then
16 PTHREADS_CFLAGS=-pthreads
17 PTHREADS_LIBS=-pthreads
24 native_pthread_support="if running netbsd 1.6T or newer"
25 dnl heim_threads.h knows this
29 native_pthread_support=yes
31 *-*-linux* | *-*-linux-gnu)
34 native_pthread_support=yes
35 PTHREADS_CFLAGS=-pthread
36 PTHREADS_LIBS=-pthread
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
45 mips-sgi-irix6.[[5-9]]) # maybe works for earlier versions too
46 native_pthread_support=yes
47 PTHREADS_LIBS="-lpthread"
50 native_pthread_support=yes
53 native_pthread_support=no
57 if test "$enable_pthread_support" = maybe ; then
58 enable_pthread_support="$native_pthread_support"
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
66 LIBS="$PTHREADS_LIBS $LIBS"
72 AC_SUBST(PTHREADS_CFLAGS)
73 AC_SUBST(PTHREADS_LIBS)
75 AC_MSG_RESULT($enable_pthread_support)