From 9a60fe478e4153e06a2fadca792181e3826fa0e8 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 25 Nov 2004 00:57:46 +0000 Subject: * unix/tcl.m4 (SC_ENABLE_THREADS): Corrected failure to determine the number of arguments for readdir_r on SunOS systems. [Bug 1071701] * unix/configure: autoconf-2.57 --- ChangeLog | 5 +++++ unix/configure | 23 +++++++++++++++++++++-- unix/tcl.m4 | 20 ++++++++++++++++++-- 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index f4b47cf..4777d57 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,11 @@ 2004-11-24 Don Porter + * unix/tcl.m4 (SC_ENABLE_THREADS): Corrected failure to determine + the number of arguments for readdir_r on SunOS systems. [Bug 1071701] + + * unix/configure: autoconf-2.57 + * generic/tclCmdIL.c (InfoVarsCmd): Corrected segfault in new * tests/info.test (info-19.6): trivial matching branch [Bug 1072654] diff --git a/unix/configure b/unix/configure index 1bc459b..6c077b1 100755 --- a/unix/configure +++ b/unix/configure @@ -4218,6 +4218,13 @@ cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF + if test "`uname -s`" = "SunOS" ; then + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + fi cat >>confdefs.h <<\_ACEOF #define _THREAD_SAFE 1 @@ -4982,7 +4989,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include -#include +#ifdef NO_DIRENT_H +# include /* logic from tcl/compat/dirent.h * +# define dirent direct * */ +#else +# include +#endif + int main () { @@ -5025,7 +5038,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include -#include +#ifdef NO_DIRENT_H +# include /* logic from tcl/compat/dirent.h * +# define dirent direct * */ +#else +# include +#endif + int main () { diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 38aca2b..7fd2f15 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -438,6 +438,10 @@ AC_DEFUN(SC_ENABLE_THREADS, [ AC_DEFINE(USE_THREAD_STORAGE, 1, [Use the generic thread storage subsystem?]) AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) + if test "`uname -s`" = "SunOS" ; then + AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, + [Do we really want to follow the standard? Yes we do!]) + fi AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?]) AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) if test "$tcl_ok" = "no"; then @@ -518,12 +522,24 @@ AC_DEFUN(SC_ENABLE_THREADS, [ AC_CACHE_VAL(tcl_cv_two_arg_readdir_r, AC_TRY_COMPILE([#include #include -#include ], [readdir_r(NULL, NULL);], +#ifdef NO_DIRENT_H +# include /* logic from tcl/compat/dirent.h * +# define dirent direct * */ +#else +# include +#endif +], [readdir_r(NULL, NULL);], tcl_cv_two_arg_readdir_r=yes, tcl_cv_two_arg_readdir_r=no)) AC_CACHE_VAL(tcl_cv_three_arg_readdir_r, AC_TRY_COMPILE([#include #include -#include ], [readdir_r(NULL, NULL, NULL);], +#ifdef NO_DIRENT_H +# include /* logic from tcl/compat/dirent.h * +# define dirent direct * */ +#else +# include +#endif +], [readdir_r(NULL, NULL, NULL);], tcl_cv_three_arg_readdir_r=yes, tcl_cv_three_arg_readdir_r=no)) if test "x$tcl_cv_two_arg_readdir_r" = "xyes" ; then AC_MSG_RESULT([2]) -- cgit v0.12