diff options
author | Kevin B Kenny <kennykb@acm.org> | 2001-04-09 23:02:21 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2001-04-09 23:02:21 (GMT) |
commit | 17d36faef9d874db9535c846fd672161df37803d (patch) | |
tree | 15f22c02304c9a814bae22a2e3ced6adf71d985c | |
parent | 32c13b3778a26251f9c69ccc78007c9c1c9a21de (diff) | |
download | tcl-17d36faef9d874db9535c846fd672161df37803d.zip tcl-17d36faef9d874db9535c846fd672161df37803d.tar.gz tcl-17d36faef9d874db9535c846fd672161df37803d.tar.bz2 |
Changes to support re-entrant coding of gmtime and localtime.
(Bugs #219136 and #232558)
-rw-r--r-- | ChangeLog | 8 | ||||
-rwxr-xr-x | unix/configure | 400 | ||||
-rw-r--r-- | unix/tcl.m4 | 14 | ||||
-rw-r--r-- | unix/tclUnixTime.c | 118 |
4 files changed, 371 insertions, 169 deletions
@@ -1,3 +1,11 @@ +2001-04-09 Kevin B. Kenny <kennykb@acm.org> + + * unix/tcl.m4: Added _REENTRANT to Solaris build so that thread + safe library routines are included. + * unix/configure: Re-ran 'autoconf' with changed tcl.m4 + * tclUnixTime.c: Modified for thread safety of 'gmtime' and + 'localtime' system calls [Bugs #219136 and #232558] + 2001-04-09 Donal K. Fellows <fellowsd@cs.man.ac.uk> * tests/expr.test (expr-21.*): Tests to check below fix. diff --git a/unix/configure b/unix/configure index 835273a..38942b3 100755 --- a/unix/configure +++ b/unix/configure @@ -2670,17 +2670,73 @@ EOF fi + for ac_func in gmtime_r localtime_r +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2677: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2682 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + + echo $ac_n "checking tm_tzadj in struct tm""... $ac_c" 1>&6 -echo "configure:2675: checking tm_tzadj in struct tm" >&5 +echo "configure:2731: checking tm_tzadj in struct tm" >&5 cat > conftest.$ac_ext <<EOF -#line 2677 "configure" +#line 2733 "configure" #include "confdefs.h" #include <time.h> int main() { struct tm tm; tm.tm_tzadj; ; return 0; } EOF -if { (eval echo configure:2684: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2740: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_TM_TZADJ 1 @@ -2696,16 +2752,16 @@ fi rm -f conftest* echo $ac_n "checking tm_gmtoff in struct tm""... $ac_c" 1>&6 -echo "configure:2700: checking tm_gmtoff in struct tm" >&5 +echo "configure:2756: checking tm_gmtoff in struct tm" >&5 cat > conftest.$ac_ext <<EOF -#line 2702 "configure" +#line 2758 "configure" #include "confdefs.h" #include <time.h> int main() { struct tm tm; tm.tm_gmtoff; ; return 0; } EOF -if { (eval echo configure:2709: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2765: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_TM_GMTOFF 1 @@ -2726,9 +2782,9 @@ rm -f conftest* # have_timezone=no echo $ac_n "checking long timezone variable""... $ac_c" 1>&6 -echo "configure:2730: checking long timezone variable" >&5 +echo "configure:2786: checking long timezone variable" >&5 cat > conftest.$ac_ext <<EOF -#line 2732 "configure" +#line 2788 "configure" #include "confdefs.h" #include <time.h> int main() { @@ -2737,7 +2793,7 @@ extern long timezone; exit (0); ; return 0; } EOF -if { (eval echo configure:2741: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2797: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* have_timezone=yes cat >> confdefs.h <<\EOF @@ -2758,9 +2814,9 @@ rm -f conftest* # if test "$have_timezone" = no; then echo $ac_n "checking time_t timezone variable""... $ac_c" 1>&6 -echo "configure:2762: checking time_t timezone variable" >&5 +echo "configure:2818: checking time_t timezone variable" >&5 cat > conftest.$ac_ext <<EOF -#line 2764 "configure" +#line 2820 "configure" #include "confdefs.h" #include <time.h> int main() { @@ -2769,7 +2825,7 @@ extern time_t timezone; exit (0); ; return 0; } EOF -if { (eval echo configure:2773: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2829: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_TIMEZONE_VAR 1 @@ -2792,12 +2848,12 @@ rm -f conftest* # in struct stat. But we might be able to use fstatfs instead. #-------------------------------------------------------------------- echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 -echo "configure:2796: checking for st_blksize in struct stat" >&5 +echo "configure:2852: checking for st_blksize in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2801 "configure" +#line 2857 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/stat.h> @@ -2805,7 +2861,7 @@ int main() { struct stat s; s.st_blksize; ; return 0; } EOF -if { (eval echo configure:2809: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blksize=yes else @@ -2826,12 +2882,12 @@ EOF fi echo $ac_n "checking for fstatfs""... $ac_c" 1>&6 -echo "configure:2830: checking for fstatfs" >&5 +echo "configure:2886: checking for fstatfs" >&5 if eval "test \"`echo '$''{'ac_cv_func_fstatfs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2835 "configure" +#line 2891 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char fstatfs(); below. */ @@ -2854,7 +2910,7 @@ fstatfs(); ; return 0; } EOF -if { (eval echo configure:2858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_fstatfs=yes" else @@ -2883,7 +2939,7 @@ fi # data, this checks it and add memcmp.o to LIBOBJS if needed #-------------------------------------------------------------------- echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:2887: checking for 8-bit clean memcmp" >&5 +echo "configure:2943: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2891,7 +2947,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <<EOF -#line 2895 "configure" +#line 2951 "configure" #include "confdefs.h" main() @@ -2901,7 +2957,7 @@ main() } EOF -if { (eval echo configure:2905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -2925,12 +2981,12 @@ test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" # {The replacement define is in compat/string.h} #-------------------------------------------------------------------- echo $ac_n "checking for memmove""... $ac_c" 1>&6 -echo "configure:2929: checking for memmove" >&5 +echo "configure:2985: checking for memmove" >&5 if eval "test \"`echo '$''{'ac_cv_func_memmove'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2934 "configure" +#line 2990 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char memmove(); below. */ @@ -2953,7 +3009,7 @@ memmove(); ; return 0; } EOF -if { (eval echo configure:2957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_memmove=yes" else @@ -2986,12 +3042,12 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking proper strstr implementation""... $ac_c" 1>&6 -echo "configure:2990: checking proper strstr implementation" >&5 +echo "configure:3046: checking proper strstr implementation" >&5 if test "$cross_compiling" = yes; then tcl_ok=no else cat > conftest.$ac_ext <<EOF -#line 2995 "configure" +#line 3051 "configure" #include "confdefs.h" extern int strstr(); @@ -3001,7 +3057,7 @@ int main() } EOF -if { (eval echo configure:3005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_ok=yes else @@ -3027,12 +3083,12 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for strtoul""... $ac_c" 1>&6 -echo "configure:3031: checking for strtoul" >&5 +echo "configure:3087: checking for strtoul" >&5 if eval "test \"`echo '$''{'ac_cv_func_strtoul'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3036 "configure" +#line 3092 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char strtoul(); below. */ @@ -3055,7 +3111,7 @@ strtoul(); ; return 0; } EOF -if { (eval echo configure:3059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strtoul=yes" else @@ -3079,7 +3135,7 @@ if test "$cross_compiling" = yes; then tcl_ok=0 else cat > conftest.$ac_ext <<EOF -#line 3083 "configure" +#line 3139 "configure" #include "confdefs.h" extern int strtoul(); @@ -3095,7 +3151,7 @@ int main() exit(0); } EOF -if { (eval echo configure:3099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3118,12 +3174,12 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for strtod""... $ac_c" 1>&6 -echo "configure:3122: checking for strtod" >&5 +echo "configure:3178: checking for strtod" >&5 if eval "test \"`echo '$''{'ac_cv_func_strtod'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3127 "configure" +#line 3183 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char strtod(); below. */ @@ -3146,7 +3202,7 @@ strtod(); ; return 0; } EOF -if { (eval echo configure:3150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strtod=yes" else @@ -3170,7 +3226,7 @@ if test "$cross_compiling" = yes; then tcl_ok=0 else cat > conftest.$ac_ext <<EOF -#line 3174 "configure" +#line 3230 "configure" #include "confdefs.h" extern double strtod(); @@ -3186,7 +3242,7 @@ int main() exit(0); } EOF -if { (eval echo configure:3190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3212,12 +3268,12 @@ fi echo $ac_n "checking for strtod""... $ac_c" 1>&6 -echo "configure:3216: checking for strtod" >&5 +echo "configure:3272: checking for strtod" >&5 if eval "test \"`echo '$''{'ac_cv_func_strtod'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3221 "configure" +#line 3277 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char strtod(); below. */ @@ -3240,7 +3296,7 @@ strtod(); ; return 0; } EOF -if { (eval echo configure:3244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strtod=yes" else @@ -3262,12 +3318,12 @@ fi if test "$tcl_strtod" = 1; then echo $ac_n "checking for Solaris2.4/Tru64 strtod bugs""... $ac_c" 1>&6 -echo "configure:3266: checking for Solaris2.4/Tru64 strtod bugs" >&5 +echo "configure:3322: checking for Solaris2.4/Tru64 strtod bugs" >&5 if test "$cross_compiling" = yes; then tcl_ok=0 else cat > conftest.$ac_ext <<EOF -#line 3271 "configure" +#line 3327 "configure" #include "confdefs.h" extern double strtod(); @@ -3287,7 +3343,7 @@ else exit(0); } EOF -if { (eval echo configure:3291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_ok=1 else @@ -3318,12 +3374,12 @@ EOF #-------------------------------------------------------------------- echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3322: checking for ANSI C header files" >&5 +echo "configure:3378: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3327 "configure" +#line 3383 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -3331,7 +3387,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3335: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3391: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3348,7 +3404,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 3352 "configure" +#line 3408 "configure" #include "confdefs.h" #include <string.h> EOF @@ -3366,7 +3422,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 3370 "configure" +#line 3426 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -3387,7 +3443,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 3391 "configure" +#line 3447 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3398,7 +3454,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:3402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3422,12 +3478,12 @@ EOF fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:3426: checking for mode_t" >&5 +echo "configure:3482: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3431 "configure" +#line 3487 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -3455,12 +3511,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:3459: checking for pid_t" >&5 +echo "configure:3515: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3464 "configure" +#line 3520 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -3488,12 +3544,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3492: checking for size_t" >&5 +echo "configure:3548: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3497 "configure" +#line 3553 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -3521,12 +3577,12 @@ EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:3525: checking for uid_t in sys/types.h" >&5 +echo "configure:3581: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3530 "configure" +#line 3586 "configure" #include "confdefs.h" #include <sys/types.h> EOF @@ -3563,12 +3619,12 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for opendir""... $ac_c" 1>&6 -echo "configure:3567: checking for opendir" >&5 +echo "configure:3623: checking for opendir" >&5 if eval "test \"`echo '$''{'ac_cv_func_opendir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3572 "configure" +#line 3628 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char opendir(); below. */ @@ -3591,7 +3647,7 @@ opendir(); ; return 0; } EOF -if { (eval echo configure:3595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_opendir=yes" else @@ -3624,9 +3680,9 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking union wait""... $ac_c" 1>&6 -echo "configure:3628: checking union wait" >&5 +echo "configure:3684: checking union wait" >&5 cat > conftest.$ac_ext <<EOF -#line 3630 "configure" +#line 3686 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/wait.h> @@ -3638,7 +3694,7 @@ WIFEXITED(x); /* Generates compiler error if WIFEXITED ; return 0; } EOF -if { (eval echo configure:3642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcl_ok=yes else @@ -3662,9 +3718,9 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking matherr support""... $ac_c" 1>&6 -echo "configure:3666: checking matherr support" >&5 +echo "configure:3722: checking matherr support" >&5 cat > conftest.$ac_ext <<EOF -#line 3668 "configure" +#line 3724 "configure" #include "confdefs.h" #include <math.h> int main() { @@ -3675,7 +3731,7 @@ x.type = SING; ; return 0; } EOF -if { (eval echo configure:3679: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_ok=yes else @@ -3700,12 +3756,12 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for strncasecmp""... $ac_c" 1>&6 -echo "configure:3704: checking for strncasecmp" >&5 +echo "configure:3760: checking for strncasecmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_strncasecmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3709 "configure" +#line 3765 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char strncasecmp(); below. */ @@ -3728,7 +3784,7 @@ strncasecmp(); ; return 0; } EOF -if { (eval echo configure:3732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strncasecmp=yes" else @@ -3750,7 +3806,7 @@ fi if test "$tcl_ok" = 0; then echo $ac_n "checking for strncasecmp in -lsocket""... $ac_c" 1>&6 -echo "configure:3754: checking for strncasecmp in -lsocket" >&5 +echo "configure:3810: checking for strncasecmp in -lsocket" >&5 ac_lib_var=`echo socket'_'strncasecmp | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3758,7 +3814,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <<EOF -#line 3762 "configure" +#line 3818 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3769,7 +3825,7 @@ int main() { strncasecmp() ; return 0; } EOF -if { (eval echo configure:3773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3793,7 +3849,7 @@ fi fi if test "$tcl_ok" = 0; then echo $ac_n "checking for strncasecmp in -linet""... $ac_c" 1>&6 -echo "configure:3797: checking for strncasecmp in -linet" >&5 +echo "configure:3853: checking for strncasecmp in -linet" >&5 ac_lib_var=`echo inet'_'strncasecmp | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3801,7 +3857,7 @@ else ac_save_LIBS="$LIBS" LIBS="-linet $LIBS" cat > conftest.$ac_ext <<EOF -#line 3805 "configure" +#line 3861 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3812,7 +3868,7 @@ int main() { strncasecmp() ; return 0; } EOF -if { (eval echo configure:3816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3850,12 +3906,12 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for BSDgettimeofday""... $ac_c" 1>&6 -echo "configure:3854: checking for BSDgettimeofday" >&5 +echo "configure:3910: checking for BSDgettimeofday" >&5 if eval "test \"`echo '$''{'ac_cv_func_BSDgettimeofday'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3859 "configure" +#line 3915 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char BSDgettimeofday(); below. */ @@ -3878,7 +3934,7 @@ BSDgettimeofday(); ; return 0; } EOF -if { (eval echo configure:3882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_BSDgettimeofday=yes" else @@ -3900,12 +3956,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gettimeofday""... $ac_c" 1>&6 -echo "configure:3904: checking for gettimeofday" >&5 +echo "configure:3960: checking for gettimeofday" >&5 if eval "test \"`echo '$''{'ac_cv_func_gettimeofday'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3909 "configure" +#line 3965 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gettimeofday(); below. */ @@ -3928,7 +3984,7 @@ gettimeofday(); ; return 0; } EOF -if { (eval echo configure:3932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gettimeofday=yes" else @@ -3955,9 +4011,9 @@ fi fi echo $ac_n "checking for gettimeofday declaration""... $ac_c" 1>&6 -echo "configure:3959: checking for gettimeofday declaration" >&5 +echo "configure:4015: checking for gettimeofday declaration" >&5 cat > conftest.$ac_ext <<EOF -#line 3961 "configure" +#line 4017 "configure" #include "confdefs.h" #include <sys/time.h> EOF @@ -3985,14 +4041,14 @@ rm -f conftest* #-------------------------------------------------------------------- echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6 -echo "configure:3989: checking whether char is unsigned" >&5 +echo "configure:4045: checking whether char is unsigned" >&5 if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$GCC" = yes; then # GCC predefines this symbol on systems where it applies. cat > conftest.$ac_ext <<EOF -#line 3996 "configure" +#line 4052 "configure" #include "confdefs.h" #ifdef __CHAR_UNSIGNED__ yes @@ -4014,7 +4070,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 4018 "configure" +#line 4074 "configure" #include "confdefs.h" /* volatile prevents gcc2 from optimizing the test away on sparcs. */ #if !defined(__STDC__) || __STDC__ != 1 @@ -4024,7 +4080,7 @@ main() { volatile char c = 255; exit(c < 0); } EOF -if { (eval echo configure:4028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_char_unsigned=yes else @@ -4048,9 +4104,9 @@ EOF fi echo $ac_n "checking signed char declarations""... $ac_c" 1>&6 -echo "configure:4052: checking signed char declarations" >&5 +echo "configure:4108: checking signed char declarations" >&5 cat > conftest.$ac_ext <<EOF -#line 4054 "configure" +#line 4110 "configure" #include "confdefs.h" int main() { @@ -4060,7 +4116,7 @@ p = 0; ; return 0; } EOF -if { (eval echo configure:4064: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_ok=yes else @@ -4091,12 +4147,12 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for sin""... $ac_c" 1>&6 -echo "configure:4095: checking for sin" >&5 +echo "configure:4151: checking for sin" >&5 if eval "test \"`echo '$''{'ac_cv_func_sin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4100 "configure" +#line 4156 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char sin(); below. */ @@ -4119,7 +4175,7 @@ sin(); ; return 0; } EOF -if { (eval echo configure:4123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_sin=yes" else @@ -4140,7 +4196,7 @@ MATH_LIBS="-lm" fi echo $ac_n "checking for main in -lieee""... $ac_c" 1>&6 -echo "configure:4144: checking for main in -lieee" >&5 +echo "configure:4200: checking for main in -lieee" >&5 ac_lib_var=`echo ieee'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4148,14 +4204,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lieee $LIBS" cat > conftest.$ac_ext <<EOF -#line 4152 "configure" +#line 4208 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:4159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4182,7 +4238,7 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for main in -linet""... $ac_c" 1>&6 -echo "configure:4186: checking for main in -linet" >&5 +echo "configure:4242: checking for main in -linet" >&5 ac_lib_var=`echo inet'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4190,14 +4246,14 @@ else ac_save_LIBS="$LIBS" LIBS="-linet $LIBS" cat > conftest.$ac_ext <<EOF -#line 4194 "configure" +#line 4250 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:4201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4219,17 +4275,17 @@ fi ac_safe=`echo "net/errno.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for net/errno.h""... $ac_c" 1>&6 -echo "configure:4223: checking for net/errno.h" >&5 +echo "configure:4279: checking for net/errno.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4228 "configure" +#line 4284 "configure" #include "confdefs.h" #include <net/errno.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4233: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4289: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4274,12 +4330,12 @@ fi tcl_checkBoth=0 echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:4278: checking for connect" >&5 +echo "configure:4334: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4283 "configure" +#line 4339 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect(); below. */ @@ -4302,7 +4358,7 @@ connect(); ; return 0; } EOF -if { (eval echo configure:4306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -4324,12 +4380,12 @@ fi if test "$tcl_checkSocket" = 1; then echo $ac_n "checking for setsockopt""... $ac_c" 1>&6 -echo "configure:4328: checking for setsockopt" >&5 +echo "configure:4384: checking for setsockopt" >&5 if eval "test \"`echo '$''{'ac_cv_func_setsockopt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4333 "configure" +#line 4389 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char setsockopt(); below. */ @@ -4352,7 +4408,7 @@ setsockopt(); ; return 0; } EOF -if { (eval echo configure:4356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_setsockopt=yes" else @@ -4370,7 +4426,7 @@ if eval "test \"`echo '$ac_cv_func_'setsockopt`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for setsockopt in -lsocket""... $ac_c" 1>&6 -echo "configure:4374: checking for setsockopt in -lsocket" >&5 +echo "configure:4430: checking for setsockopt in -lsocket" >&5 ac_lib_var=`echo socket'_'setsockopt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4378,7 +4434,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <<EOF -#line 4382 "configure" +#line 4438 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4389,7 +4445,7 @@ int main() { setsockopt() ; return 0; } EOF -if { (eval echo configure:4393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4417,12 +4473,12 @@ fi tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" echo $ac_n "checking for accept""... $ac_c" 1>&6 -echo "configure:4421: checking for accept" >&5 +echo "configure:4477: checking for accept" >&5 if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4426 "configure" +#line 4482 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char accept(); below. */ @@ -4445,7 +4501,7 @@ accept(); ; return 0; } EOF -if { (eval echo configure:4449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_accept=yes" else @@ -4467,12 +4523,12 @@ fi fi echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:4471: checking for gethostbyname" >&5 +echo "configure:4527: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4476 "configure" +#line 4532 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname(); below. */ @@ -4495,7 +4551,7 @@ gethostbyname(); ; return 0; } EOF -if { (eval echo configure:4499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -4513,7 +4569,7 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:4517: checking for gethostbyname in -lnsl" >&5 +echo "configure:4573: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4521,7 +4577,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <<EOF -#line 4525 "configure" +#line 4581 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4532,7 +4588,7 @@ int main() { gethostbyname() ; return 0; } EOF -if { (eval echo configure:4536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4578,7 +4634,7 @@ LIBS="$LIBS$THREADS_LIBS" # Step 0.a: Enable 64 bit support? echo $ac_n "checking if 64bit support is requested""... $ac_c" 1>&6 -echo "configure:4582: checking if 64bit support is requested" >&5 +echo "configure:4638: checking if 64bit support is requested" >&5 # Check whether --enable-64bit or --disable-64bit was given. if test "${enable_64bit+set}" = set; then enableval="$enable_64bit" @@ -4598,7 +4654,7 @@ fi # Step 0.b: Enable Solaris 64 bit VIS support? echo $ac_n "checking if 64bit Sparc VIS support is requested""... $ac_c" 1>&6 -echo "configure:4602: checking if 64bit Sparc VIS support is requested" >&5 +echo "configure:4658: checking if 64bit Sparc VIS support is requested" >&5 # Check whether --enable-64bit-vis or --disable-64bit-vis was given. if test "${enable_64bit_vis+set}" = set; then enableval="$enable_64bit_vis" @@ -4622,7 +4678,7 @@ fi # there are a few systems, like Next, where this doesn't work. echo $ac_n "checking system version (for dynamic loading)""... $ac_c" 1>&6 -echo "configure:4626: checking system version (for dynamic loading)" >&5 +echo "configure:4682: checking system version (for dynamic loading)" >&5 if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else @@ -4645,7 +4701,7 @@ echo "configure:4626: checking system version (for dynamic loading)" >&5 fi echo $ac_n "checking if gcc is being used""... $ac_c" 1>&6 -echo "configure:4649: checking if gcc is being used" >&5 +echo "configure:4705: checking if gcc is being used" >&5 if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then using_gcc="yes" else @@ -4658,7 +4714,7 @@ echo "configure:4649: checking if gcc is being used" >&5 # Linux can use either -ldl or -ldld for dynamic loading. echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:4662: checking for dlopen in -ldl" >&5 +echo "configure:4718: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4666,7 +4722,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <<EOF -#line 4670 "configure" +#line 4726 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4677,7 +4733,7 @@ int main() { dlopen() ; return 0; } EOF -if { (eval echo configure:4681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4796,7 +4852,7 @@ fi # known GMT value. echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6 -echo "configure:4800: checking for gettimeofday in -lbsd" >&5 +echo "configure:4856: checking for gettimeofday in -lbsd" >&5 ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4804,7 +4860,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbsd $LIBS" cat > conftest.$ac_ext <<EOF -#line 4808 "configure" +#line 4864 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4815,7 +4871,7 @@ int main() { gettimeofday() ; return 0; } EOF -if { (eval echo configure:4819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4877,7 +4933,7 @@ EOF HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*|HP-UX-*.11.*) SHLIB_SUFFIX=".sl" echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:4881: checking for shl_load in -ldld" >&5 +echo "configure:4937: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4885,7 +4941,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <<EOF -#line 4889 "configure" +#line 4945 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4896,7 +4952,7 @@ int main() { shl_load() ; return 0; } EOF -if { (eval echo configure:4900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5003,17 +5059,17 @@ fi else ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dld.h""... $ac_c" 1>&6 -echo "configure:5007: checking for dld.h" >&5 +echo "configure:5063: checking for dld.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5012 "configure" +#line 5068 "configure" #include "confdefs.h" #include <dld.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5017: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5073: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5068,17 +5124,17 @@ fi # Not available on all versions: check for include file. ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:5072: checking for dlfcn.h" >&5 +echo "configure:5128: checking for dlfcn.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5077 "configure" +#line 5133 "configure" #include "confdefs.h" #include <dlfcn.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5082: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5138: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5105,9 +5161,9 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then LDFLAGS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' echo $ac_n "checking for ELF""... $ac_c" 1>&6 -echo "configure:5109: checking for ELF" >&5 +echo "configure:5165: checking for ELF" >&5 cat > conftest.$ac_ext <<EOF -#line 5111 "configure" +#line 5167 "configure" #include "confdefs.h" #ifdef __ELF__ @@ -5285,6 +5341,15 @@ EOF TCL_LIB_VERSIONS_OK=nodots ;; SunOS-5.[0-6]*) + + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + cat >> confdefs.h <<\EOF +#define _REENTRANT 1 +EOF + + SHLIB_CFLAGS="-KPIC" SHLIB_LD="/usr/ccs/bin/ld -G -z text" @@ -5299,6 +5364,15 @@ EOF LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' ;; SunOS-5*) + + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + cat >> confdefs.h <<\EOF +#define _REENTRANT 1 +EOF + + SHLIB_CFLAGS="-KPIC" SHLIB_LD="/usr/ccs/bin/ld -G -z text" LDFLAGS="" @@ -5360,17 +5434,17 @@ EOF # that don't grok the -Bexport option. Test that it does. hold_ldflags=$LDFLAGS echo $ac_n "checking for ld accepts -Bexport flag""... $ac_c" 1>&6 -echo "configure:5364: checking for ld accepts -Bexport flag" >&5 +echo "configure:5438: checking for ld accepts -Bexport flag" >&5 LDFLAGS="${LDFLAGS} -Wl,-Bexport" cat > conftest.$ac_ext <<EOF -#line 5367 "configure" +#line 5441 "configure" #include "confdefs.h" int main() { int i; ; return 0; } EOF -if { (eval echo configure:5374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* found=yes else @@ -5416,9 +5490,9 @@ rm -f conftest* if test "x$DL_OBJS" = "xtclLoadAout.o" ; then echo $ac_n "checking sys/exec.h""... $ac_c" 1>&6 -echo "configure:5420: checking sys/exec.h" >&5 +echo "configure:5494: checking sys/exec.h" >&5 cat > conftest.$ac_ext <<EOF -#line 5422 "configure" +#line 5496 "configure" #include "confdefs.h" #include <sys/exec.h> int main() { @@ -5436,7 +5510,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5440: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_ok=usable else @@ -5454,9 +5528,9 @@ EOF else echo $ac_n "checking a.out.h""... $ac_c" 1>&6 -echo "configure:5458: checking a.out.h" >&5 +echo "configure:5532: checking a.out.h" >&5 cat > conftest.$ac_ext <<EOF -#line 5460 "configure" +#line 5534 "configure" #include "confdefs.h" #include <a.out.h> int main() { @@ -5474,7 +5548,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5478: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5552: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_ok=usable else @@ -5492,9 +5566,9 @@ EOF else echo $ac_n "checking sys/exec_aout.h""... $ac_c" 1>&6 -echo "configure:5496: checking sys/exec_aout.h" >&5 +echo "configure:5570: checking sys/exec_aout.h" >&5 cat > conftest.$ac_ext <<EOF -#line 5498 "configure" +#line 5572 "configure" #include "confdefs.h" #include <sys/exec_aout.h> int main() { @@ -5512,7 +5586,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5516: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5590: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_ok=usable else @@ -5607,7 +5681,7 @@ fi echo $ac_n "checking for build with symbols""... $ac_c" 1>&6 -echo "configure:5611: checking for build with symbols" >&5 +echo "configure:5685: checking for build with symbols" >&5 # Check whether --enable-symbols or --disable-symbols was given. if test "${enable_symbols+set}" = set; then enableval="$enable_symbols" @@ -5644,17 +5718,17 @@ CFLAGS=${CFLAGS_DEFAULT} do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5648: checking for $ac_hdr" >&5 +echo "configure:5722: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5653 "configure" +#line 5727 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5658: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5684,17 +5758,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5688: checking for $ac_hdr" >&5 +echo "configure:5762: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5693 "configure" +#line 5767 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5698: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5772: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5721,7 +5795,7 @@ fi done echo $ac_n "checking FIONBIO vs. O_NONBLOCK for nonblocking I/O""... $ac_c" 1>&6 -echo "configure:5725: checking FIONBIO vs. O_NONBLOCK for nonblocking I/O" >&5 +echo "configure:5799: checking FIONBIO vs. O_NONBLOCK for nonblocking I/O" >&5 if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else @@ -5783,7 +5857,7 @@ TCL_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX} echo $ac_n "checking how to build libraries""... $ac_c" 1>&6 -echo "configure:5787: checking how to build libraries" >&5 +echo "configure:5861: checking how to build libraries" >&5 # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 0bef313..1d9af67 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -986,6 +986,12 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ TCL_LIB_VERSIONS_OK=nodots ;; SunOS-5.[[0-6]]*) + + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + AC_DEFINE(_REENTRANT) + SHLIB_CFLAGS="-KPIC" SHLIB_LD="/usr/ccs/bin/ld -G -z text" @@ -1000,6 +1006,12 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' ;; SunOS-5*) + + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + AC_DEFINE(_REENTRANT) + SHLIB_CFLAGS="-KPIC" SHLIB_LD="/usr/ccs/bin/ld -G -z text" LDFLAGS="" @@ -1623,6 +1635,8 @@ AC_DEFUN(SC_TIME_HANDLER, [ AC_HEADER_TIME AC_STRUCT_TIMEZONE + AC_CHECK_FUNCS(gmtime_r localtime_r) + AC_MSG_CHECKING([tm_tzadj in struct tm]) AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_tzadj;], [AC_DEFINE(HAVE_TM_TZADJ) diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c index 9990aad..b0c5e9f 100644 --- a/unix/tclUnixTime.c +++ b/unix/tclUnixTime.c @@ -9,13 +9,37 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixTime.c,v 1.7 2000/01/14 22:15:52 ericm Exp $ + * RCS: @(#) $Id: tclUnixTime.c,v 1.8 2001/04/09 23:02:21 kennykb Exp $ */ #include "tclInt.h" #include "tclPort.h" #define TM_YEAR_BASE 1900 #define IsLeapYear(x) ((x % 4 == 0) && (x % 100 != 0 || x % 400 == 0)) + +/* + * TclpGetDate is coded to return a pointer to a 'struct tm'. For + * thread safety, this structure must be in thread-specific data. + * The 'tmKey' variable is the key to this buffer. + */ + +Tcl_ThreadDataKey tmKey; + +/* + * If we fall back on the thread-unsafe versions of gmtime and localtime, + * use this mutex to try to protect them. + */ + +#if !defined(HAVE_GMTIME_R) || !defined(HAVE_LOCALTIME_R) +TCL_DECLARE_MUTEX( tmMutex ) +#endif + +/* + * Forward declarations for procedures defined later in this file. + */ + +static struct tm *ThreadSafeGMTime _ANSI_ARGS_(( CONST time_t* )); +static struct tm *ThreadSafeLocalTime _ANSI_ARGS_(( CONST time_t* )); /* *----------------------------------------------------------------------------- @@ -115,7 +139,7 @@ TclpGetTimeZone (currentTime) #if defined(HAVE_TM_TZADJ) # define TCL_GOT_TIMEZONE time_t curTime = (time_t) currentTime; - struct tm *timeDataPtr = localtime(&curTime); + struct tm *timeDataPtr = ThreadSafeLocalTime(&curTime); int timeZone; timeZone = timeDataPtr->tm_tzadj / 60; @@ -129,7 +153,7 @@ TclpGetTimeZone (currentTime) #if defined(HAVE_TM_GMTOFF) && !defined (TCL_GOT_TIMEZONE) # define TCL_GOT_TIMEZONE time_t curTime = (time_t) currentTime; - struct tm *timeDataPtr = localtime(&curTime); + struct tm *timeDataPtr = ThreadSafeLocalTime(&curTime); int timeZone; timeZone = -(timeDataPtr->tm_gmtoff / 60); @@ -152,7 +176,7 @@ TclpGetTimeZone (currentTime) time_t tt; struct tm *stm; tt = 849268800L; /* 1996-11-29 12:00:00 GMT */ - stm = localtime(&tt); /* eg 1996-11-29 6:00:00 CST6CDT */ + stm = ThreadSafeLocalTime(&tt); /* eg 1996-11-29 6:00:00 CST6CDT */ /* The calculation below assumes a max of +12 or -12 hours from GMT */ timeZone = (12 - stm->tm_hour)*60 + (0 - stm->tm_min); return timeZone; /* eg +360 for CST6CDT */ @@ -268,9 +292,9 @@ TclpGetDate(time, useGMT) CONST time_t *tp = (CONST time_t *)time; if (useGMT) { - return gmtime(tp); + return ThreadSafeGMTime(tp); } else { - return localtime(tp); + return ThreadSafeLocalTime(tp); } } @@ -308,3 +332,85 @@ TclpStrftime(s, maxsize, format, t) } return strftime(s, maxsize, format, t); } + +/* + *---------------------------------------------------------------------- + * + * ThreadSafeGMTime -- + * + * Wrapper around the 'gmtime' library function to make it thread + * safe. + * + * Results: + * Returns a pointer to a 'struct tm' in thread-specific data. + * + * Side effects: + * Invokes gmtime or gmtime_r as appropriate. + * + *---------------------------------------------------------------------- + */ + +static struct tm * +ThreadSafeGMTime( timePtr ) + CONST time_t *timePtr; /* Pointer to the number of seconds + * since the local system's epoch + */ + +{ + + /* + * Get a thread-local buffer to hold the returned time. + */ + + struct tm * tmPtr = (struct tm*) Tcl_GetThreadData( &tmKey, + sizeof( struct tm ) ); +#ifdef HAVE_GMTIME_R + gmtime_r( timePtr, tmPtr ); +#else + Tcl_MutexLock( & tmMutex ); + *tmPtr = gmtime( timePtr ); + Tcl_MutexUnlock( &tmMutex ); +#endif + return tmPtr; +} + +/* + *---------------------------------------------------------------------- + * + * ThreadSafeLocalTime -- + * + * Wrapper around the 'localtime' library function to make it thread + * safe. + * + * Results: + * Returns a pointer to a 'struct tm' in thread-specific data. + * + * Side effects: + * Invokes localtime or localtime_r as appropriate. + * + *---------------------------------------------------------------------- + */ + +static struct tm * +ThreadSafeLocalTime( timePtr ) + CONST time_t *timePtr; /* Pointer to the number of seconds + * since the local system's epoch + */ + +{ + + /* + * Get a thread-local buffer to hold the returned time. + */ + + struct tm * tmPtr = (struct tm*) Tcl_GetThreadData( &tmKey, + sizeof( struct tm ) ); +#ifdef HAVE_LOCALTIME_R + localtime_r( timePtr, tmPtr ); +#else + Tcl_MutexLock( & tmMutex ); + *tmPtr = localtime( timePtr ); + Tcl_MutexUnlock( &tmMutex ); +#endif + return tmPtr; +} |