From d6a522034dba3eed8776e4752ea99295ac8a936c Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 12 Nov 2004 14:18:11 +0000 Subject: * unix/tcl.m4, unix/tclUnixPort.h: Check for pthread_attr_get_np in before forcing the use of to make things work on NetBSD 2.0. [Bug 1064882] --- ChangeLog | 4 ++++ unix/tcl.m4 | 35 ++++++++++++++++++++++++++--------- unix/tclUnixPort.h | 10 ++++++++-- 3 files changed, 38 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index a610791..68aea6f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2004-11-12 Donal K. Fellows + * unix/tcl.m4, unix/tclUnixPort.h: Check for pthread_attr_get_np + in before forcing the use of to make + things work on NetBSD 2.0. [Bug 1064882] + * doc/binary.n, doc/upvar.n: More minor fixes. 2004-11-12 Daniel Steffen diff --git a/unix/tcl.m4 b/unix/tcl.m4 index d7a4f8b..55175ad 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -476,15 +476,32 @@ AC_DEFUN(SC_ENABLE_THREADS, [ ac_saved_libs=$LIBS LIBS="$LIBS $THREADS_LIBS" AC_CHECK_FUNCS(pthread_attr_setstacksize) - AC_CHECK_FUNCS(pthread_attr_get_np pthread_getattr_np) - AC_MSG_CHECKING([for pthread_getattr_np declaration]) - AC_CACHE_VAL(tcl_cv_grep_pthread_getattr_np, - AC_EGREP_HEADER(pthread_getattr_np, pthread.h, - tcl_cv_grep_pthread_getattr_np=present, - tcl_cv_grep_pthread_getattr_np=missing)) - AC_MSG_RESULT($tcl_cv_grep_pthread_getattr_np) - if test $tcl_cv_grep_pthread_getattr_np = missing ; then - AC_DEFINE(GETATTRNP_NOT_DECLARED) + AC_CHECK_FUNC(pthread_attr_get_np,tcl_ok=yes,tcl_ok=no) + if test $tcl_ok = yes ; then + AC_DEFINE(HAVE_PTHREAD_ATTR_GET_NP) + AC_MSG_CHECKING([for pthread_attr_get_np declaration]) + AC_CACHE_VAL(tcl_cv_grep_pthread_attr_get_np, + AC_EGREP_HEADER(pthread_attr_get_np, pthread.h, + tcl_cv_grep_pthread_attr_get_np=present, + tcl_cv_grep_pthread_attr_get_np=missing)) + AC_MSG_RESULT($tcl_cv_grep_pthread_attr_get_np) + if test $tcl_cv_grep_pthread_attr_get_np = missing ; then + AC_DEFINE(ATTRGETNP_NOT_DECLARED) + fi + else + AC_CHECK_FUNC(pthread_getattr_np,tcl_ok=yes,tcl_ok=no) + if test $tcl_ok = yes ; then + AC_DEFINE(HAVE_PTHREAD_GETATTR_NP) + AC_MSG_CHECKING([for pthread_getattr_np declaration]) + AC_CACHE_VAL(tcl_cv_grep_pthread_getattr_np, + AC_EGREP_HEADER(pthread_getattr_np, pthread.h, + tcl_cv_grep_pthread_getattr_np=present, + tcl_cv_grep_pthread_getattr_np=missing)) + AC_MSG_RESULT($tcl_cv_grep_pthread_getattr_np) + if test $tcl_cv_grep_pthread_getattr_np = missing ; then + AC_DEFINE(GETATTRNP_NOT_DECLARED) + fi + fi fi LIBS=$ac_saved_libs AC_CHECK_FUNCS(readdir_r) diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h index 93a9285..190fc5f 100644 --- a/unix/tclUnixPort.h +++ b/unix/tclUnixPort.h @@ -19,7 +19,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixPort.h,v 1.38 2004/06/23 00:24:42 dkf Exp $ + * RCS: @(#) $Id: tclUnixPort.h,v 1.39 2004/11/12 14:18:29 dkf Exp $ */ #ifndef _TCLUNIXPORT @@ -577,8 +577,14 @@ EXTERN char * TclpInetNtoa(struct in_addr); # define NO_REALPATH # endif # ifdef HAVE_PTHREAD_ATTR_GET_NP -# include # define TclpPthreadGetAttrs pthread_attr_get_np +# ifdef ATTRGETNP_NOT_DECLARED +/* + * Assume it is in pthread_np.h if it isn't in pthread.h. [Bug 1064882] + * We might need to revisit this in the future. :^( + */ +# include +# endif # else # ifdef HAVE_PTHREAD_GETATTR_NP # define TclpPthreadGetAttrs pthread_getattr_np -- cgit v0.12