3 AC_DEFUN([KRB_PTHREADS], [
4 AC_MSG_CHECKING(if compiling threadsafe libraries)
6 AC_ARG_ENABLE(pthread-support,
7 AS_HELP_STRING([--enable-pthread-support],
8 [if you want thread safe libraries]),
9 [],[enable_pthread_support=maybe])
13 native_pthread_support=yes
14 if test "$GCC" = yes; then
15 PTHREADS_CFLAGS=-pthreads
16 PTHREADS_LIBS=-pthreads
23 native_pthread_support="if running netbsd 1.6T or newer"
24 dnl heim_threads.h knows this
28 native_pthread_support=yes
30 *-*-linux* | *-*-linux-gnu)
33 native_pthread_support=yes
34 PTHREADS_CFLAGS=-pthread
35 PTHREADS_LIBS=-pthread
40 dnl AIX is disabled since we don't handle the utmp/utmpx
41 dnl problems that aix causes when compiling with pthread support
42 native_pthread_support=no
44 mips-sgi-irix6.[[5-9]]) # maybe works for earlier versions too
45 native_pthread_support=yes
46 PTHREADS_LIBS="-lpthread"
49 native_pthread_support=yes
52 native_pthread_support=no
56 if test "$enable_pthread_support" = maybe ; then
57 enable_pthread_support="$native_pthread_support"
60 if test "$enable_pthread_support" != no; then
61 AC_DEFINE(ENABLE_PTHREAD_SUPPORT, 1,
62 [Define if you want have a thread safe libraries])
63 dnl This sucks, but libtool doesn't save the depenecy on -pthread
65 LIBS="$PTHREADS_LIBS $LIBS"
71 AC_SUBST(PTHREADS_CFLAGS)
72 AC_SUBST(PTHREADS_LIBS)
74 AC_MSG_RESULT($enable_pthread_support)