rework how pthreads support to turned on/off, always run though the
switch to figure out what the linker/compiler flag are git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15349 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -3,18 +3,14 @@ dnl $Id$
|
|||||||
AC_DEFUN([KRB_PTHREADS], [
|
AC_DEFUN([KRB_PTHREADS], [
|
||||||
AC_MSG_CHECKING(if compiling threadsafe libraries)
|
AC_MSG_CHECKING(if compiling threadsafe libraries)
|
||||||
|
|
||||||
if test "$PTHREADS_LIBS" = "" ; then
|
|
||||||
PTHREADS_LIBS="-pthread"
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(pthread-support,
|
AC_ARG_ENABLE(pthread-support,
|
||||||
AS_HELP_STRING([--enable-pthread-support],
|
AS_HELP_STRING([--enable-pthread-support],
|
||||||
[if you want thread safe libraries]),
|
[if you want thread safe libraries]),
|
||||||
[],[enable_pthread_support=maybe])
|
[],[enable_pthread_support=maybe])
|
||||||
if test "$enable_pthread_support" = maybe; then
|
|
||||||
case "$host" in
|
case "$host" in
|
||||||
*-*-solaris2*)
|
*-*-solaris2*)
|
||||||
enable_pthread_support=yes
|
native_pthread_support=yes
|
||||||
if test "$GCC" = yes; then
|
if test "$GCC" = yes; then
|
||||||
PTHREADS_CFLAGS=-pthreads
|
PTHREADS_CFLAGS=-pthreads
|
||||||
PTHREADS_LIBS=-pthreads
|
PTHREADS_LIBS=-pthreads
|
||||||
@@ -24,41 +20,47 @@ case "$host" in
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*-*-netbsd*)
|
*-*-netbsd*)
|
||||||
enable_pthread_support="if running netbsd 1.6T or newer"
|
native_pthread_support="if running netbsd 1.6T or newer"
|
||||||
dnl heim_threads.h knows this
|
dnl heim_threads.h knows this
|
||||||
PTHREADS_LIBS=""
|
PTHREADS_LIBS=""
|
||||||
;;
|
;;
|
||||||
*-*-freebsd5*)
|
*-*-freebsd5*)
|
||||||
enable_pthread_support=yes
|
native_pthread_support=yes
|
||||||
;;
|
;;
|
||||||
*-*-linux* | *-*-linux-gnu)
|
*-*-linux* | *-*-linux-gnu)
|
||||||
case `uname -r` in
|
case `uname -r` in
|
||||||
2.*)
|
2.*)
|
||||||
enable_pthread_support=yes
|
native_pthread_support=yes
|
||||||
PTHREADS_CFLAGS=-pthread
|
PTHREADS_CFLAGS=-pthread
|
||||||
|
PTHREADS_LIBS=-pthread
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
*-*-aix*)
|
*-*-aix*)
|
||||||
if test "$GCC" = yes; then
|
if test "$GCC" = yes; then
|
||||||
enable_pthread_support=yes
|
native_pthread_support=yes
|
||||||
|
PTHREADS_LIBS="-pthread"
|
||||||
elif expr "$CC" : ".*_r" > /dev/null ; then
|
elif expr "$CC" : ".*_r" > /dev/null ; then
|
||||||
enable_pthread_support=yes
|
native_pthread_support=yes
|
||||||
PTHREADS_CFLAGS=""
|
PTHREADS_CFLAGS=""
|
||||||
PTHREADS_LIBS=""
|
PTHREADS_LIBS=""
|
||||||
else
|
else
|
||||||
enable_pthread_support=no
|
native_pthread_support=no
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
mips-sgi-irix6.[[5-9]]) # maybe works for earlier versions too
|
mips-sgi-irix6.[[5-9]]) # maybe works for earlier versions too
|
||||||
enable_pthread_support=yes
|
native_pthread_support=yes
|
||||||
PTHREADS_LIBS="-lpthread"
|
PTHREADS_LIBS="-lpthread"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
enable_pthread_support=no
|
native_pthread_support=no
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if test "$enable_pthread_support" = maybe ; then
|
||||||
|
enable_pthread_support="$native_pthread_support"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$enable_pthread_support" != no; then
|
if test "$enable_pthread_support" != no; then
|
||||||
AC_DEFINE(ENABLE_PTHREAD_SUPPORT, 1,
|
AC_DEFINE(ENABLE_PTHREAD_SUPPORT, 1,
|
||||||
[Define if you want have a thread safe libraries])
|
[Define if you want have a thread safe libraries])
|
||||||
|
Reference in New Issue
Block a user