From a30dfdf6428d636cf316a8fdd9d3210c1230af00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Tue, 22 Jul 2003 18:44:16 +0000 Subject: [PATCH] pthread test git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12487 ec53bebd-3082-4978-b11e-865c3cabbd6b --- cf/pthreads.m4 | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 cf/pthreads.m4 diff --git a/cf/pthreads.m4 b/cf/pthreads.m4 new file mode 100644 index 000000000..aa3944453 --- /dev/null +++ b/cf/pthreads.m4 @@ -0,0 +1,49 @@ +dnl $Id$ + +AC_DEFUN(KRB_PTHREADS, [ +AC_MSG_CHECKING(if compiling threadsafe libraries) + +if test "$PTHREADS_LDFLAGS" = "" ; then + PTHREADS_LDFLAGS="-pthread" +fi + +AC_ARG_ENABLE(pthread-support, + AC_HELP_STRING([--enable-pthread-support], + [if you want thread safe libraries]), + [],[enable_pthread_support=maybe]) +if test "$enable_pthread_support" = maybe; then +case "$host" in +*-*-solaris2*) + enable_pthread_support=yes + ;; +*-*-netbsd*) + enable_pthread_support="if running netbsd 1.6T or newer" + dnl heim_threads.h knows this + ;; +*-*-freebsd5*) + enable_pthread_support=yes + ;; +*-*-linux2[4-9]*) + enable_pthread_support=yes + ;; +*-*-aix*) + enable_pthread_support=yes + ;; +*) + enable_pthread_support=no + ;; +esac +fi +if test "$enable_pthread_support" = no; then + AC_DEFINE(ENABLE_PTHREAD_SUPPORT, 1, + [Define if you want have a thread safe libraries]) +else + PTHREADS_CFLAGS="" + PTHREADS_LDFLAGS="" +fi + +AC_SUBST(PTHREADS_CFLAGS) +AC_SUBST(PTHREADS_LDFLAGS) + +AC_MSG_RESULT($enable_pthread_support) +])