Tcl Source Code

Changes On Branch tip-491
Login
Bounty program for improvements to Tcl and certain Tcl packages.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch tip-491 Excluding Merge-Ins

This is equivalent to a diff from f21a25950c to 89b3d0671b

2018-05-17
18:53
TIP #491 implementation: Threading Support: phasing out non-threaded builds check-in: e9ee6fc387 user: jan.nijtmans tags: core-8-branch
2018-04-19
02:45
merge 8.6 check-in: 91f1174d86 user: dgp tags: core-8-branch
2018-04-17
22:48
Merge 8.7 Move stuff from SC_ENABLE_THREADS to SC_TCL_LINK_LIBS in tcl.m4, so SC_ENABLE_THREADS is n... Closed-Leaf check-in: 89b3d0671b user: jan.nijtmans tags: tip-491
14:39
merge 8.7 check-in: acf839cd31 user: dgp tags: trunk
14:39
merge 8.6 check-in: f21a25950c user: dgp tags: core-8-branch
14:38
merge 8.5 check-in: c3b11f3af9 user: dgp tags: core-8-6-branch
2018-04-16
14:51
ran autoconf on the unix directory. This breaks the build. check-in: b4ff6833b3 user: dgp tags: tip-491
2018-04-07
17:07
merge 8.6 check-in: 82ddedafd7 user: dgp tags: core-8-branch

Changes to generic/tcl.h.

    86     86   #  define STRINGIFY1(x) #x
    87     87   #endif
    88     88   #ifndef JOIN
    89     89   #  define JOIN(a,b) JOIN1(a,b)
    90     90   #  define JOIN1(a,b) a##b
    91     91   #endif
    92     92   #endif /* !TCL_NO_DEPRECATED */
           93  +
           94  +#ifndef TCL_THREADS
           95  +#   define TCL_THREADS 1
           96  +#endif
    93     97   
    94     98   /*
    95     99    * A special definition used to allow this header file to be included from
    96    100    * windows resource files so that they can obtain version information.
    97    101    * RC_INVOKED is defined by default by the windows RC tool.
    98    102    *
    99    103    * Resource compilers don't like all the C stuff, like typedefs and function

Changes to generic/tclInt.h.

  4193   4193   	    (objPtr)->length = -1; \
  4194   4194   	    TclFreeObjStorage(objPtr); \
  4195   4195   	    TclIncrObjsFreed(); \
  4196   4196   	} else { \
  4197   4197   	    TclFreeObj(objPtr); \
  4198   4198   	} \
  4199   4199       }
         4200  +
         4201  +#if TCL_THREADS && !defined(USE_THREAD_ALLOC)
         4202  +#   define USE_THREAD_ALLOC 1
         4203  +#endif
  4200   4204   
  4201   4205   #if defined(PURIFY)
  4202   4206   
  4203   4207   /*
  4204   4208    * The PURIFY mode is like the regular mode, but instead of doing block
  4205   4209    * Tcl_Obj allocation and keeping a freed list for efficiency, it always
  4206   4210    * allocates and frees a single Tcl_Obj so that tools like Purify can better

Changes to unix/configure.

   695    695   LIBOBJS
   696    696   AR
   697    697   RANLIB
   698    698   ZLIB_INCLUDE
   699    699   ZLIB_SRCS
   700    700   ZLIB_OBJS
   701    701   TCLSH_PROG
   702         -TCL_THREADS
   703    702   EGREP
   704    703   GREP
   705    704   CPP
   706    705   OBJEXT
   707    706   EXEEXT
   708    707   ac_ct_CC
   709    708   CPPFLAGS
................................................................................
   751    750   SHELL'
   752    751   ac_subst_files=''
   753    752   ac_user_opts='
   754    753   enable_option_checking
   755    754   enable_man_symlinks
   756    755   enable_man_compression
   757    756   enable_man_suffix
   758         -enable_threads
   759    757   with_encoding
   760    758   enable_shared
   761    759   enable_64bit
   762    760   enable_64bit_vis
   763    761   enable_rpath
   764    762   enable_corefoundation
   765    763   enable_load
................................................................................
  1391   1389     --enable-man-symlinks   use symlinks for the manpages (default: off)
  1392   1390     --enable-man-compression=PROG
  1393   1391                             compress the manpages with PROG (default: off)
  1394   1392     --enable-man-suffix=STRING
  1395   1393                             use STRING as a suffix to manpage file names
  1396   1394                             (default: no, tcl if enabled without
  1397   1395                             specifying STRING)
  1398         -  --enable-threads        build with threads (default: on)
  1399   1396     --enable-shared         build and link with shared libraries (default: on)
  1400   1397     --enable-64bit          enable 64bit support (default: off)
  1401   1398     --enable-64bit-vis      enable 64bit Sparc VIS support (default: off)
  1402   1399     --disable-rpath         disable rpath support (default: on)
  1403   1400     --enable-corefoundation use CoreFoundation API on MacOSX (default: on)
  1404   1401     --enable-load           allow dynamic loading and "load" command (default:
  1405   1402                             on)
................................................................................
  3905   3902   fi
  3906   3903   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_pipe" >&5
  3907   3904   $as_echo "$tcl_cv_cc_pipe" >&6; }
  3908   3905       if test $tcl_cv_cc_pipe = yes; then
  3909   3906   	CFLAGS="$CFLAGS -pipe"
  3910   3907       fi
  3911   3908   fi
  3912         -
  3913         -#------------------------------------------------------------------------
  3914         -# Threads support
  3915         -#------------------------------------------------------------------------
  3916         -
  3917         -
  3918         -    # Check whether --enable-threads was given.
  3919         -if test "${enable_threads+set}" = set; then :
  3920         -  enableval=$enable_threads; tcl_ok=$enableval
  3921         -else
  3922         -  tcl_ok=yes
  3923         -fi
  3924         -
  3925         -
  3926         -    if test "${TCL_THREADS}" = 1; then
  3927         -	tcl_threaded_core=1;
  3928         -    fi
  3929         -
  3930         -    if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
  3931         -	TCL_THREADS=1
  3932         -	# USE_THREAD_ALLOC tells us to try the special thread-based
  3933         -	# allocator that significantly reduces lock contention
  3934         -
  3935         -$as_echo "#define USE_THREAD_ALLOC 1" >>confdefs.h
  3936         -
  3937         -
  3938         -$as_echo "#define _REENTRANT 1" >>confdefs.h
  3939         -
  3940         -	if test "`uname -s`" = "SunOS" ; then
  3941         -
  3942         -$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
  3943         -
  3944         -	fi
  3945         -
  3946         -$as_echo "#define _THREAD_SAFE 1" >>confdefs.h
  3947         -
  3948         -	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5
  3949         -$as_echo_n "checking for pthread_mutex_init in -lpthread... " >&6; }
  3950         -if ${ac_cv_lib_pthread_pthread_mutex_init+:} false; then :
  3951         -  $as_echo_n "(cached) " >&6
  3952         -else
  3953         -  ac_check_lib_save_LIBS=$LIBS
  3954         -LIBS="-lpthread  $LIBS"
  3955         -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  3956         -/* end confdefs.h.  */
  3957         -
  3958         -/* Override any GCC internal prototype to avoid an error.
  3959         -   Use char because int might match the return type of a GCC
  3960         -   builtin and then its argument prototype would still apply.  */
  3961         -#ifdef __cplusplus
  3962         -extern "C"
  3963         -#endif
  3964         -char pthread_mutex_init ();
  3965         -int
  3966         -main ()
  3967         -{
  3968         -return pthread_mutex_init ();
  3969         -  ;
  3970         -  return 0;
  3971         -}
  3972         -_ACEOF
  3973         -if ac_fn_c_try_link "$LINENO"; then :
  3974         -  ac_cv_lib_pthread_pthread_mutex_init=yes
  3975         -else
  3976         -  ac_cv_lib_pthread_pthread_mutex_init=no
  3977         -fi
  3978         -rm -f core conftest.err conftest.$ac_objext \
  3979         -    conftest$ac_exeext conftest.$ac_ext
  3980         -LIBS=$ac_check_lib_save_LIBS
  3981         -fi
  3982         -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5
  3983         -$as_echo "$ac_cv_lib_pthread_pthread_mutex_init" >&6; }
  3984         -if test "x$ac_cv_lib_pthread_pthread_mutex_init" = xyes; then :
  3985         -  tcl_ok=yes
  3986         -else
  3987         -  tcl_ok=no
  3988         -fi
  3989         -
  3990         -	if test "$tcl_ok" = "no"; then
  3991         -	    # Check a little harder for __pthread_mutex_init in the same
  3992         -	    # library, as some systems hide it there until pthread.h is
  3993         -	    # defined.  We could alternatively do an AC_TRY_COMPILE with
  3994         -	    # pthread.h, but that will work with libpthread really doesn't
  3995         -	    # exist, like AIX 4.2.  [Bug: 4359]
  3996         -	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __pthread_mutex_init in -lpthread" >&5
  3997         -$as_echo_n "checking for __pthread_mutex_init in -lpthread... " >&6; }
  3998         -if ${ac_cv_lib_pthread___pthread_mutex_init+:} false; then :
  3999         -  $as_echo_n "(cached) " >&6
  4000         -else
  4001         -  ac_check_lib_save_LIBS=$LIBS
  4002         -LIBS="-lpthread  $LIBS"
  4003         -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  4004         -/* end confdefs.h.  */
  4005         -
  4006         -/* Override any GCC internal prototype to avoid an error.
  4007         -   Use char because int might match the return type of a GCC
  4008         -   builtin and then its argument prototype would still apply.  */
  4009         -#ifdef __cplusplus
  4010         -extern "C"
  4011         -#endif
  4012         -char __pthread_mutex_init ();
  4013         -int
  4014         -main ()
  4015         -{
  4016         -return __pthread_mutex_init ();
  4017         -  ;
  4018         -  return 0;
  4019         -}
  4020         -_ACEOF
  4021         -if ac_fn_c_try_link "$LINENO"; then :
  4022         -  ac_cv_lib_pthread___pthread_mutex_init=yes
  4023         -else
  4024         -  ac_cv_lib_pthread___pthread_mutex_init=no
  4025         -fi
  4026         -rm -f core conftest.err conftest.$ac_objext \
  4027         -    conftest$ac_exeext conftest.$ac_ext
  4028         -LIBS=$ac_check_lib_save_LIBS
  4029         -fi
  4030         -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5
  4031         -$as_echo "$ac_cv_lib_pthread___pthread_mutex_init" >&6; }
  4032         -if test "x$ac_cv_lib_pthread___pthread_mutex_init" = xyes; then :
  4033         -  tcl_ok=yes
  4034         -else
  4035         -  tcl_ok=no
  4036         -fi
  4037         -
  4038         -	fi
  4039         -
  4040         -	if test "$tcl_ok" = "yes"; then
  4041         -	    # The space is needed
  4042         -	    THREADS_LIBS=" -lpthread"
  4043         -	else
  4044         -	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthreads" >&5
  4045         -$as_echo_n "checking for pthread_mutex_init in -lpthreads... " >&6; }
  4046         -if ${ac_cv_lib_pthreads_pthread_mutex_init+:} false; then :
  4047         -  $as_echo_n "(cached) " >&6
  4048         -else
  4049         -  ac_check_lib_save_LIBS=$LIBS
  4050         -LIBS="-lpthreads  $LIBS"
  4051         -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  4052         -/* end confdefs.h.  */
  4053         -
  4054         -/* Override any GCC internal prototype to avoid an error.
  4055         -   Use char because int might match the return type of a GCC
  4056         -   builtin and then its argument prototype would still apply.  */
  4057         -#ifdef __cplusplus
  4058         -extern "C"
  4059         -#endif
  4060         -char pthread_mutex_init ();
  4061         -int
  4062         -main ()
  4063         -{
  4064         -return pthread_mutex_init ();
  4065         -  ;
  4066         -  return 0;
  4067         -}
  4068         -_ACEOF
  4069         -if ac_fn_c_try_link "$LINENO"; then :
  4070         -  ac_cv_lib_pthreads_pthread_mutex_init=yes
  4071         -else
  4072         -  ac_cv_lib_pthreads_pthread_mutex_init=no
  4073         -fi
  4074         -rm -f core conftest.err conftest.$ac_objext \
  4075         -    conftest$ac_exeext conftest.$ac_ext
  4076         -LIBS=$ac_check_lib_save_LIBS
  4077         -fi
  4078         -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5
  4079         -$as_echo "$ac_cv_lib_pthreads_pthread_mutex_init" >&6; }
  4080         -if test "x$ac_cv_lib_pthreads_pthread_mutex_init" = xyes; then :
  4081         -  tcl_ok=yes
  4082         -else
  4083         -  tcl_ok=no
  4084         -fi
  4085         -
  4086         -	    if test "$tcl_ok" = "yes"; then
  4087         -		# The space is needed
  4088         -		THREADS_LIBS=" -lpthreads"
  4089         -	    else
  4090         -		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc" >&5
  4091         -$as_echo_n "checking for pthread_mutex_init in -lc... " >&6; }
  4092         -if ${ac_cv_lib_c_pthread_mutex_init+:} false; then :
  4093         -  $as_echo_n "(cached) " >&6
  4094         -else
  4095         -  ac_check_lib_save_LIBS=$LIBS
  4096         -LIBS="-lc  $LIBS"
  4097         -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  4098         -/* end confdefs.h.  */
  4099         -
  4100         -/* Override any GCC internal prototype to avoid an error.
  4101         -   Use char because int might match the return type of a GCC
  4102         -   builtin and then its argument prototype would still apply.  */
  4103         -#ifdef __cplusplus
  4104         -extern "C"
  4105         -#endif
  4106         -char pthread_mutex_init ();
  4107         -int
  4108         -main ()
  4109         -{
  4110         -return pthread_mutex_init ();
  4111         -  ;
  4112         -  return 0;
  4113         -}
  4114         -_ACEOF
  4115         -if ac_fn_c_try_link "$LINENO"; then :
  4116         -  ac_cv_lib_c_pthread_mutex_init=yes
  4117         -else
  4118         -  ac_cv_lib_c_pthread_mutex_init=no
  4119         -fi
  4120         -rm -f core conftest.err conftest.$ac_objext \
  4121         -    conftest$ac_exeext conftest.$ac_ext
  4122         -LIBS=$ac_check_lib_save_LIBS
  4123         -fi
  4124         -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_pthread_mutex_init" >&5
  4125         -$as_echo "$ac_cv_lib_c_pthread_mutex_init" >&6; }
  4126         -if test "x$ac_cv_lib_c_pthread_mutex_init" = xyes; then :
  4127         -  tcl_ok=yes
  4128         -else
  4129         -  tcl_ok=no
  4130         -fi
  4131         -
  4132         -		if test "$tcl_ok" = "no"; then
  4133         -		    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc_r" >&5
  4134         -$as_echo_n "checking for pthread_mutex_init in -lc_r... " >&6; }
  4135         -if ${ac_cv_lib_c_r_pthread_mutex_init+:} false; then :
  4136         -  $as_echo_n "(cached) " >&6
  4137         -else
  4138         -  ac_check_lib_save_LIBS=$LIBS
  4139         -LIBS="-lc_r  $LIBS"
  4140         -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  4141         -/* end confdefs.h.  */
  4142         -
  4143         -/* Override any GCC internal prototype to avoid an error.
  4144         -   Use char because int might match the return type of a GCC
  4145         -   builtin and then its argument prototype would still apply.  */
  4146         -#ifdef __cplusplus
  4147         -extern "C"
  4148         -#endif
  4149         -char pthread_mutex_init ();
  4150         -int
  4151         -main ()
  4152         -{
  4153         -return pthread_mutex_init ();
  4154         -  ;
  4155         -  return 0;
  4156         -}
  4157         -_ACEOF
  4158         -if ac_fn_c_try_link "$LINENO"; then :
  4159         -  ac_cv_lib_c_r_pthread_mutex_init=yes
  4160         -else
  4161         -  ac_cv_lib_c_r_pthread_mutex_init=no
  4162         -fi
  4163         -rm -f core conftest.err conftest.$ac_objext \
  4164         -    conftest$ac_exeext conftest.$ac_ext
  4165         -LIBS=$ac_check_lib_save_LIBS
  4166         -fi
  4167         -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5
  4168         -$as_echo "$ac_cv_lib_c_r_pthread_mutex_init" >&6; }
  4169         -if test "x$ac_cv_lib_c_r_pthread_mutex_init" = xyes; then :
  4170         -  tcl_ok=yes
  4171         -else
  4172         -  tcl_ok=no
  4173         -fi
  4174         -
  4175         -		    if test "$tcl_ok" = "yes"; then
  4176         -			# The space is needed
  4177         -			THREADS_LIBS=" -pthread"
  4178         -		    else
  4179         -			TCL_THREADS=0
  4180         -			{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..." >&5
  4181         -$as_echo "$as_me: WARNING: Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..." >&2;}
  4182         -		    fi
  4183         -		fi
  4184         -	    fi
  4185         -	fi
  4186         -
  4187         -	# Does the pthread-implementation provide
  4188         -	# 'pthread_attr_setstacksize' ?
  4189         -
  4190         -	ac_saved_libs=$LIBS
  4191         -	LIBS="$LIBS $THREADS_LIBS"
  4192         -	for ac_func in pthread_attr_setstacksize pthread_atfork
  4193         -do :
  4194         -  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
  4195         -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
  4196         -if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
  4197         -  cat >>confdefs.h <<_ACEOF
  4198         -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
  4199         -_ACEOF
  4200         -
  4201         -fi
  4202         -done
  4203         -
  4204         -	LIBS=$ac_saved_libs
  4205         -    else
  4206         -	TCL_THREADS=0
  4207         -    fi
  4208         -    # Do checking message here to not mess up interleaved configure output
  4209         -    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for building with threads" >&5
  4210         -$as_echo_n "checking for building with threads... " >&6; }
  4211         -    if test "${TCL_THREADS}" = 1; then
  4212         -
  4213         -$as_echo "#define TCL_THREADS 1" >>confdefs.h
  4214         -
  4215         -	if test "${tcl_threaded_core}" = 1; then
  4216         -	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (threaded core)" >&5
  4217         -$as_echo "yes (threaded core)" >&6; }
  4218         -	else
  4219         -	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
  4220         -$as_echo "yes" >&6; }
  4221         -	fi
  4222         -    else
  4223         -	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
  4224         -$as_echo "no" >&6; }
  4225         -    fi
  4226         -
  4227         -
  4228         -
  4229   3909   
  4230   3910   #------------------------------------------------------------------------
  4231   3911   # Embedded configuration information, encoding to use for the values, TIP #59
  4232   3912   #------------------------------------------------------------------------
  4233   3913   
  4234   3914   
  4235   3915   
................................................................................
  4449   4129   if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
  4450   4130     LIBS="$LIBS -lnsl"
  4451   4131   fi
  4452   4132   
  4453   4133   fi
  4454   4134   
  4455   4135   
         4136  +
         4137  +$as_echo "#define _REENTRANT 1" >>confdefs.h
         4138  +
         4139  +
         4140  +$as_echo "#define _THREAD_SAFE 1" >>confdefs.h
         4141  +
         4142  +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5
         4143  +$as_echo_n "checking for pthread_mutex_init in -lpthread... " >&6; }
         4144  +if ${ac_cv_lib_pthread_pthread_mutex_init+:} false; then :
         4145  +  $as_echo_n "(cached) " >&6
         4146  +else
         4147  +  ac_check_lib_save_LIBS=$LIBS
         4148  +LIBS="-lpthread  $LIBS"
         4149  +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
         4150  +/* end confdefs.h.  */
         4151  +
         4152  +/* Override any GCC internal prototype to avoid an error.
         4153  +   Use char because int might match the return type of a GCC
         4154  +   builtin and then its argument prototype would still apply.  */
         4155  +#ifdef __cplusplus
         4156  +extern "C"
         4157  +#endif
         4158  +char pthread_mutex_init ();
         4159  +int
         4160  +main ()
         4161  +{
         4162  +return pthread_mutex_init ();
         4163  +  ;
         4164  +  return 0;
         4165  +}
         4166  +_ACEOF
         4167  +if ac_fn_c_try_link "$LINENO"; then :
         4168  +  ac_cv_lib_pthread_pthread_mutex_init=yes
         4169  +else
         4170  +  ac_cv_lib_pthread_pthread_mutex_init=no
         4171  +fi
         4172  +rm -f core conftest.err conftest.$ac_objext \
         4173  +    conftest$ac_exeext conftest.$ac_ext
         4174  +LIBS=$ac_check_lib_save_LIBS
         4175  +fi
         4176  +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5
         4177  +$as_echo "$ac_cv_lib_pthread_pthread_mutex_init" >&6; }
         4178  +if test "x$ac_cv_lib_pthread_pthread_mutex_init" = xyes; then :
         4179  +  tcl_ok=yes
         4180  +else
         4181  +  tcl_ok=no
         4182  +fi
         4183  +
         4184  +    if test "$tcl_ok" = "no"; then
         4185  +	# Check a little harder for __pthread_mutex_init in the same
         4186  +	# library, as some systems hide it there until pthread.h is
         4187  +	# defined.  We could alternatively do an AC_TRY_COMPILE with
         4188  +	# pthread.h, but that will work with libpthread really doesn't
         4189  +	# exist, like AIX 4.2.  [Bug: 4359]
         4190  +	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __pthread_mutex_init in -lpthread" >&5
         4191  +$as_echo_n "checking for __pthread_mutex_init in -lpthread... " >&6; }
         4192  +if ${ac_cv_lib_pthread___pthread_mutex_init+:} false; then :
         4193  +  $as_echo_n "(cached) " >&6
         4194  +else
         4195  +  ac_check_lib_save_LIBS=$LIBS
         4196  +LIBS="-lpthread  $LIBS"
         4197  +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
         4198  +/* end confdefs.h.  */
         4199  +
         4200  +/* Override any GCC internal prototype to avoid an error.
         4201  +   Use char because int might match the return type of a GCC
         4202  +   builtin and then its argument prototype would still apply.  */
         4203  +#ifdef __cplusplus
         4204  +extern "C"
         4205  +#endif
         4206  +char __pthread_mutex_init ();
         4207  +int
         4208  +main ()
         4209  +{
         4210  +return __pthread_mutex_init ();
         4211  +  ;
         4212  +  return 0;
         4213  +}
         4214  +_ACEOF
         4215  +if ac_fn_c_try_link "$LINENO"; then :
         4216  +  ac_cv_lib_pthread___pthread_mutex_init=yes
         4217  +else
         4218  +  ac_cv_lib_pthread___pthread_mutex_init=no
         4219  +fi
         4220  +rm -f core conftest.err conftest.$ac_objext \
         4221  +    conftest$ac_exeext conftest.$ac_ext
         4222  +LIBS=$ac_check_lib_save_LIBS
         4223  +fi
         4224  +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5
         4225  +$as_echo "$ac_cv_lib_pthread___pthread_mutex_init" >&6; }
         4226  +if test "x$ac_cv_lib_pthread___pthread_mutex_init" = xyes; then :
         4227  +  tcl_ok=yes
         4228  +else
         4229  +  tcl_ok=no
         4230  +fi
         4231  +
         4232  +    fi
         4233  +
         4234  +    if test "$tcl_ok" = "yes"; then
         4235  +	# The space is needed
         4236  +	THREADS_LIBS=" -lpthread"
         4237  +    else
         4238  +	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthreads" >&5
         4239  +$as_echo_n "checking for pthread_mutex_init in -lpthreads... " >&6; }
         4240  +if ${ac_cv_lib_pthreads_pthread_mutex_init+:} false; then :
         4241  +  $as_echo_n "(cached) " >&6
         4242  +else
         4243  +  ac_check_lib_save_LIBS=$LIBS
         4244  +LIBS="-lpthreads  $LIBS"
         4245  +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
         4246  +/* end confdefs.h.  */
         4247  +
         4248  +/* Override any GCC internal prototype to avoid an error.
         4249  +   Use char because int might match the return type of a GCC
         4250  +   builtin and then its argument prototype would still apply.  */
         4251  +#ifdef __cplusplus
         4252  +extern "C"
         4253  +#endif
         4254  +char pthread_mutex_init ();
         4255  +int
         4256  +main ()
         4257  +{
         4258  +return pthread_mutex_init ();
         4259  +  ;
         4260  +  return 0;
         4261  +}
         4262  +_ACEOF
         4263  +if ac_fn_c_try_link "$LINENO"; then :
         4264  +  ac_cv_lib_pthreads_pthread_mutex_init=yes
         4265  +else
         4266  +  ac_cv_lib_pthreads_pthread_mutex_init=no
         4267  +fi
         4268  +rm -f core conftest.err conftest.$ac_objext \
         4269  +    conftest$ac_exeext conftest.$ac_ext
         4270  +LIBS=$ac_check_lib_save_LIBS
         4271  +fi
         4272  +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5
         4273  +$as_echo "$ac_cv_lib_pthreads_pthread_mutex_init" >&6; }
         4274  +if test "x$ac_cv_lib_pthreads_pthread_mutex_init" = xyes; then :
         4275  +  _ok=yes
         4276  +else
         4277  +  tcl_ok=no
         4278  +fi
         4279  +
         4280  +	if test "$tcl_ok" = "yes"; then
         4281  +	    # The space is needed
         4282  +	    THREADS_LIBS=" -lpthreads"
         4283  +	else
         4284  +	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc" >&5
         4285  +$as_echo_n "checking for pthread_mutex_init in -lc... " >&6; }
         4286  +if ${ac_cv_lib_c_pthread_mutex_init+:} false; then :
         4287  +  $as_echo_n "(cached) " >&6
         4288  +else
         4289  +  ac_check_lib_save_LIBS=$LIBS
         4290  +LIBS="-lc  $LIBS"
         4291  +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
         4292  +/* end confdefs.h.  */
         4293  +
         4294  +/* Override any GCC internal prototype to avoid an error.
         4295  +   Use char because int might match the return type of a GCC
         4296  +   builtin and then its argument prototype would still apply.  */
         4297  +#ifdef __cplusplus
         4298  +extern "C"
         4299  +#endif
         4300  +char pthread_mutex_init ();
         4301  +int
         4302  +main ()
         4303  +{
         4304  +return pthread_mutex_init ();
         4305  +  ;
         4306  +  return 0;
         4307  +}
         4308  +_ACEOF
         4309  +if ac_fn_c_try_link "$LINENO"; then :
         4310  +  ac_cv_lib_c_pthread_mutex_init=yes
         4311  +else
         4312  +  ac_cv_lib_c_pthread_mutex_init=no
         4313  +fi
         4314  +rm -f core conftest.err conftest.$ac_objext \
         4315  +    conftest$ac_exeext conftest.$ac_ext
         4316  +LIBS=$ac_check_lib_save_LIBS
         4317  +fi
         4318  +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_pthread_mutex_init" >&5
         4319  +$as_echo "$ac_cv_lib_c_pthread_mutex_init" >&6; }
         4320  +if test "x$ac_cv_lib_c_pthread_mutex_init" = xyes; then :
         4321  +  tcl_ok=yes
         4322  +else
         4323  +  tcl_ok=no
         4324  +fi
         4325  +
         4326  +	    if test "$tcl_ok" = "no"; then
         4327  +		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc_r" >&5
         4328  +$as_echo_n "checking for pthread_mutex_init in -lc_r... " >&6; }
         4329  +if ${ac_cv_lib_c_r_pthread_mutex_init+:} false; then :
         4330  +  $as_echo_n "(cached) " >&6
         4331  +else
         4332  +  ac_check_lib_save_LIBS=$LIBS
         4333  +LIBS="-lc_r  $LIBS"
         4334  +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
         4335  +/* end confdefs.h.  */
         4336  +
         4337  +/* Override any GCC internal prototype to avoid an error.
         4338  +   Use char because int might match the return type of a GCC
         4339  +   builtin and then its argument prototype would still apply.  */
         4340  +#ifdef __cplusplus
         4341  +extern "C"
         4342  +#endif
         4343  +char pthread_mutex_init ();
         4344  +int
         4345  +main ()
         4346  +{
         4347  +return pthread_mutex_init ();
         4348  +  ;
         4349  +  return 0;
         4350  +}
         4351  +_ACEOF
         4352  +if ac_fn_c_try_link "$LINENO"; then :
         4353  +  ac_cv_lib_c_r_pthread_mutex_init=yes
         4354  +else
         4355  +  ac_cv_lib_c_r_pthread_mutex_init=no
         4356  +fi
         4357  +rm -f core conftest.err conftest.$ac_objext \
         4358  +    conftest$ac_exeext conftest.$ac_ext
         4359  +LIBS=$ac_check_lib_save_LIBS
         4360  +fi
         4361  +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5
         4362  +$as_echo "$ac_cv_lib_c_r_pthread_mutex_init" >&6; }
         4363  +if test "x$ac_cv_lib_c_r_pthread_mutex_init" = xyes; then :
         4364  +  tcl_ok=yes
         4365  +else
         4366  +  tcl_ok=no
         4367  +fi
         4368  +
         4369  +		if test "$tcl_ok" = "yes"; then
         4370  +		    # The space is needed
         4371  +		    THREADS_LIBS=" -pthread"
         4372  +		else
         4373  +		    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how to find pthread lib on your system - you must edit the LIBS in the Makefile..." >&5
         4374  +$as_echo "$as_me: WARNING: Don't know how to find pthread lib on your system - you must edit the LIBS in the Makefile..." >&2;}
         4375  +		fi
         4376  +	    fi
         4377  +	fi
         4378  +    fi
         4379  +
         4380  +    # Does the pthread-implementation provide
         4381  +    # 'pthread_attr_setstacksize' ?
         4382  +
         4383  +    ac_saved_libs=$LIBS
         4384  +    LIBS="$LIBS $THREADS_LIBS"
         4385  +    for ac_func in pthread_attr_setstacksize pthread_atfork
         4386  +do :
         4387  +  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
         4388  +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
         4389  +if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
         4390  +  cat >>confdefs.h <<_ACEOF
         4391  +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
         4392  +_ACEOF
         4393  +
         4394  +fi
         4395  +done
         4396  +
         4397  +    LIBS=$ac_saved_libs
         4398  +
  4456   4399   
  4457   4400   # Add the threads support libraries
  4458   4401   LIBS="$LIBS$THREADS_LIBS"
  4459   4402   
  4460   4403   
  4461   4404       { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build libraries" >&5
  4462   4405   $as_echo_n "checking how to build libraries... " >&6; }

Changes to unix/configure.ac.

   115    115   	AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no)
   116    116   	CFLAGS=$hold_cflags])
   117    117       if test $tcl_cv_cc_pipe = yes; then
   118    118   	CFLAGS="$CFLAGS -pipe"
   119    119       fi
   120    120   fi
   121    121   
   122         -#------------------------------------------------------------------------
   123         -# Threads support
   124         -#------------------------------------------------------------------------
   125         -
   126         -SC_ENABLE_THREADS
   127         -
   128    122   #------------------------------------------------------------------------
   129    123   # Embedded configuration information, encoding to use for the values, TIP #59
   130    124   #------------------------------------------------------------------------
   131    125   
   132    126   SC_TCL_CFG_ENCODING
   133    127   
   134    128   #--------------------------------------------------------------------

Changes to unix/tcl.m4.

   588    588   		AC_MSG_RESULT([static library])
   589    589   	    fi
   590    590   	    FRAMEWORK_BUILD=0
   591    591   	fi
   592    592       fi
   593    593   ])
   594    594   
   595         -#------------------------------------------------------------------------
   596         -# SC_ENABLE_THREADS --
   597         -#
   598         -#	Specify if thread support should be enabled
   599         -#
   600         -# Arguments:
   601         -#	none
   602         -#
   603         -# Results:
   604         -#
   605         -#	Adds the following arguments to configure:
   606         -#		--enable-threads
   607         -#
   608         -#	Sets the following vars:
   609         -#		THREADS_LIBS	Thread library(s)
   610         -#
   611         -#	Defines the following vars:
   612         -#		TCL_THREADS
   613         -#		_REENTRANT
   614         -#		_THREAD_SAFE
   615         -#------------------------------------------------------------------------
   616         -
   617         -AC_DEFUN([SC_ENABLE_THREADS], [
   618         -    AC_ARG_ENABLE(threads,
   619         -	AC_HELP_STRING([--enable-threads],
   620         -	    [build with threads (default: on)]),
   621         -	[tcl_ok=$enableval], [tcl_ok=yes])
   622         -
   623         -    if test "${TCL_THREADS}" = 1; then
   624         -	tcl_threaded_core=1;
   625         -    fi
   626         -
   627         -    if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
   628         -	TCL_THREADS=1
   629         -	# USE_THREAD_ALLOC tells us to try the special thread-based
   630         -	# allocator that significantly reduces lock contention
   631         -	AC_DEFINE(USE_THREAD_ALLOC, 1,
   632         -	    [Do we want to use the threaded memory allocator?])
   633         -	AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
   634         -	if test "`uname -s`" = "SunOS" ; then
   635         -	    AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
   636         -		    [Do we really want to follow the standard? Yes we do!])
   637         -	fi
   638         -	AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?])
   639         -	AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
   640         -	if test "$tcl_ok" = "no"; then
   641         -	    # Check a little harder for __pthread_mutex_init in the same
   642         -	    # library, as some systems hide it there until pthread.h is
   643         -	    # defined.  We could alternatively do an AC_TRY_COMPILE with
   644         -	    # pthread.h, but that will work with libpthread really doesn't
   645         -	    # exist, like AIX 4.2.  [Bug: 4359]
   646         -	    AC_CHECK_LIB(pthread, __pthread_mutex_init,
   647         -		tcl_ok=yes, tcl_ok=no)
   648         -	fi
   649         -
   650         -	if test "$tcl_ok" = "yes"; then
   651         -	    # The space is needed
   652         -	    THREADS_LIBS=" -lpthread"
   653         -	else
   654         -	    AC_CHECK_LIB(pthreads, pthread_mutex_init,
   655         -		tcl_ok=yes, tcl_ok=no)
   656         -	    if test "$tcl_ok" = "yes"; then
   657         -		# The space is needed
   658         -		THREADS_LIBS=" -lpthreads"
   659         -	    else
   660         -		AC_CHECK_LIB(c, pthread_mutex_init,
   661         -		    tcl_ok=yes, tcl_ok=no)
   662         -		if test "$tcl_ok" = "no"; then
   663         -		    AC_CHECK_LIB(c_r, pthread_mutex_init,
   664         -			tcl_ok=yes, tcl_ok=no)
   665         -		    if test "$tcl_ok" = "yes"; then
   666         -			# The space is needed
   667         -			THREADS_LIBS=" -pthread"
   668         -		    else
   669         -			TCL_THREADS=0
   670         -			AC_MSG_WARN([Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile...])
   671         -		    fi
   672         -		fi
   673         -	    fi
   674         -	fi
   675         -
   676         -	# Does the pthread-implementation provide
   677         -	# 'pthread_attr_setstacksize' ?
   678         -
   679         -	ac_saved_libs=$LIBS
   680         -	LIBS="$LIBS $THREADS_LIBS"
   681         -	AC_CHECK_FUNCS(pthread_attr_setstacksize pthread_atfork)
   682         -	LIBS=$ac_saved_libs
   683         -    else
   684         -	TCL_THREADS=0
   685         -    fi
   686         -    # Do checking message here to not mess up interleaved configure output
   687         -    AC_MSG_CHECKING([for building with threads])
   688         -    if test "${TCL_THREADS}" = 1; then
   689         -	AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?])
   690         -	if test "${tcl_threaded_core}" = 1; then
   691         -	    AC_MSG_RESULT([yes (threaded core)])
   692         -	else
   693         -	    AC_MSG_RESULT([yes])
   694         -	fi
   695         -    else
   696         -	AC_MSG_RESULT([no])
   697         -    fi
   698         -
   699         -    AC_SUBST(TCL_THREADS)
   700         -])
   701         -
   702    595   #------------------------------------------------------------------------
   703    596   # SC_ENABLE_SYMBOLS --
   704    597   #
   705    598   #	Specify if debugging symbols should be used.
   706    599   #	Memory (TCL_MEM_DEBUG) and compile (TCL_COMPILE_DEBUG) debugging
   707    600   #	can also be enabled.
   708    601   #
................................................................................
  2346   2239   ])
  2347   2240   
  2348   2241   #--------------------------------------------------------------------
  2349   2242   # SC_TCL_LINK_LIBS
  2350   2243   #
  2351   2244   #	Search for the libraries needed to link the Tcl shell.
  2352   2245   #	Things like the math library (-lm) and socket stuff (-lsocket vs.
  2353         -#	-lnsl) are dealt with here.
         2246  +#	-lnsl) or thread library (-lpthread) are dealt with here.
  2354   2247   #
  2355   2248   # Arguments:
  2356   2249   #	None.
  2357   2250   #
  2358   2251   # Results:
         2252  +#
         2253  +#	Sets the following vars:
         2254  +#		THREADS_LIBS	Thread library(s)
         2255  +#
         2256  +#	Defines the following vars:
         2257  +#		TCL_THREADS
         2258  +#		_REENTRANT
         2259  +#		_THREAD_SAFE
  2359   2260   #
  2360   2261   #	Might append to the following vars:
  2361   2262   #		LIBS
  2362   2263   #		MATH_LIBS
  2363   2264   #
  2364   2265   #	Might define the following vars:
  2365   2266   #		HAVE_NET_ERRNO_H
................................................................................
  2410   2311       if test "$tcl_checkBoth" = 1; then
  2411   2312   	tk_oldLibs=$LIBS
  2412   2313   	LIBS="$LIBS -lsocket -lnsl"
  2413   2314   	AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs])
  2414   2315       fi
  2415   2316       AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname,
  2416   2317   	    [LIBS="$LIBS -lnsl"])])
         2318  +
         2319  +    AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
         2320  +    AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?])
         2321  +    AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
         2322  +    if test "$tcl_ok" = "no"; then
         2323  +	# Check a little harder for __pthread_mutex_init in the same
         2324  +	# library, as some systems hide it there until pthread.h is
         2325  +	# defined.  We could alternatively do an AC_TRY_COMPILE with
         2326  +	# pthread.h, but that will work with libpthread really doesn't
         2327  +	# exist, like AIX 4.2.  [Bug: 4359]
         2328  +	AC_CHECK_LIB(pthread, __pthread_mutex_init,
         2329  +		tcl_ok=yes, tcl_ok=no)
         2330  +    fi
         2331  +
         2332  +    if test "$tcl_ok" = "yes"; then
         2333  +	# The space is needed
         2334  +	THREADS_LIBS=" -lpthread"
         2335  +    else
         2336  +	AC_CHECK_LIB(pthreads, pthread_mutex_init,
         2337  +	_ok=yes, tcl_ok=no)
         2338  +	if test "$tcl_ok" = "yes"; then
         2339  +	    # The space is needed
         2340  +	    THREADS_LIBS=" -lpthreads"
         2341  +	else
         2342  +	    AC_CHECK_LIB(c, pthread_mutex_init,
         2343  +		    tcl_ok=yes, tcl_ok=no)
         2344  +	    if test "$tcl_ok" = "no"; then
         2345  +		AC_CHECK_LIB(c_r, pthread_mutex_init,
         2346  +			tcl_ok=yes, tcl_ok=no)
         2347  +		if test "$tcl_ok" = "yes"; then
         2348  +		    # The space is needed
         2349  +		    THREADS_LIBS=" -pthread"
         2350  +		else
         2351  +		    AC_MSG_WARN([Don't know how to find pthread lib on your system - you must edit the LIBS in the Makefile...])
         2352  +		fi
         2353  +	    fi
         2354  +	fi
         2355  +    fi
         2356  +
         2357  +    # Does the pthread-implementation provide
         2358  +    # 'pthread_attr_setstacksize' ?
         2359  +
         2360  +    ac_saved_libs=$LIBS
         2361  +    LIBS="$LIBS $THREADS_LIBS"
         2362  +    AC_CHECK_FUNCS(pthread_attr_setstacksize pthread_atfork)
         2363  +    LIBS=$ac_saved_libs
  2417   2364   ])
  2418   2365   
  2419   2366   #--------------------------------------------------------------------
  2420   2367   # SC_TCL_EARLY_FLAGS
  2421   2368   #
  2422   2369   #	Check for what flags are needed to be passed so the correct OS
  2423   2370   #	features are available.

Changes to unix/tclUnixPort.h.

   598    598   #	endif
   599    599   #	if MAC_OS_X_VERSION_MAX_ALLOWED < 1040
   600    600   #	    undef HAVE_OSSPINLOCKLOCK
   601    601   #	    undef HAVE_PTHREAD_ATFORK
   602    602   #	    undef HAVE_COPYFILE
   603    603   #	endif
   604    604   #	if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
   605         -#	    ifdef TCL_THREADS
   606         -		/* prior to 10.3, realpath is not threadsafe, c.f. bug 711232 */
   607         -#		define NO_REALPATH 1
   608         -#	    endif
          605  +	    /* prior to 10.3, realpath is not threadsafe, c.f. bug 711232 */
          606  +#	    define NO_REALPATH 1
   609    607   #	    undef HAVE_LANGINFO
   610    608   #	endif
   611    609   #   endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
   612    610   #   if defined(HAVE_COREFOUNDATION) && defined(__LP64__) && \
   613    611   	    defined(HAVE_WEAK_IMPORT) && MAC_OS_X_VERSION_MIN_REQUIRED < 1050
   614    612   #	warning "Weak import of 64-bit CoreFoundation is not supported, will not run on Mac OS X < 10.5."
   615    613   #   endif
................................................................................
   674    672    *---------------------------------------------------------------------------
   675    673    * The following macros and declaration wrap the C runtime library functions.
   676    674    *---------------------------------------------------------------------------
   677    675    */
   678    676   
   679    677   #define TclpExit	exit
   680    678   
   681         -#ifdef TCL_THREADS
          679  +#if !defined(TCL_THREADS) || TCL_THREADS
   682    680   #   include <pthread.h>
   683    681   #endif /* TCL_THREADS */
   684    682   
   685    683   /* FIXME - Hyper-enormous platform assumption! */
   686    684   #ifndef AF_INET6
   687    685   #   define AF_INET6	10
   688    686   #endif

Changes to win/configure.

   703    703   ZLIB_LIBS
   704    704   ZLIB_DLL_FILE
   705    705   CFLAGS_WARNING
   706    706   CFLAGS_OPTIMIZE
   707    707   CFLAGS_DEBUG
   708    708   DL_LIBS
   709    709   CYGPATH
   710         -TCL_THREADS
   711    710   SET_MAKE
   712    711   RC
   713    712   RANLIB
   714    713   AR
   715    714   EGREP
   716    715   GREP
   717    716   CPP
................................................................................
   759    758   PACKAGE_TARNAME
   760    759   PACKAGE_NAME
   761    760   PATH_SEPARATOR
   762    761   SHELL'
   763    762   ac_subst_files=''
   764    763   ac_user_opts='
   765    764   enable_option_checking
   766         -enable_threads
   767    765   with_encoding
   768    766   enable_shared
   769    767   enable_64bit
   770    768   enable_symbols
   771    769   enable_embedded_manifest
   772    770   '
   773    771         ac_precious_vars='build_alias
................................................................................
  1382   1380   
  1383   1381     cat <<\_ACEOF
  1384   1382   
  1385   1383   Optional Features:
  1386   1384     --disable-option-checking  ignore unrecognized --enable/--with options
  1387   1385     --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  1388   1386     --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  1389         -  --enable-threads        build with threads (default: on)
  1390   1387     --enable-shared         build and link with shared libraries (default: on)
  1391   1388     --enable-64bit          enable 64bit support (where applicable)
  1392   1389     --enable-symbols        build with debugging symbols (default: off)
  1393   1390     --enable-embedded-manifest
  1394   1391                             embed manifest if possible (default: yes)
  1395   1392   
  1396   1393   Optional Packages:
................................................................................
  3667   3664   
  3668   3665   
  3669   3666   #--------------------------------------------------------------------
  3670   3667   # Determines the correct binary file extension (.o, .obj, .exe etc.)
  3671   3668   #--------------------------------------------------------------------
  3672   3669   
  3673   3670   
  3674         -
  3675         -
  3676         -#--------------------------------------------------------------------
  3677         -# Check whether --enable-threads or --disable-threads was given.
  3678         -#--------------------------------------------------------------------
  3679         -
  3680         -
  3681         -    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for building with threads" >&5
  3682         -$as_echo_n "checking for building with threads... " >&6; }
  3683         -    # Check whether --enable-threads was given.
  3684         -if test "${enable_threads+set}" = set; then :
  3685         -  enableval=$enable_threads; tcl_ok=$enableval
  3686         -else
  3687         -  tcl_ok=yes
  3688         -fi
  3689         -
  3690         -
  3691         -    if test "$tcl_ok" = "yes"; then
  3692         -	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5
  3693         -$as_echo "yes (default)" >&6; }
  3694         -	TCL_THREADS=1
  3695         -	$as_echo "#define TCL_THREADS 1" >>confdefs.h
  3696         -
  3697         -	# USE_THREAD_ALLOC tells us to try the special thread-based
  3698         -	# allocator that significantly reduces lock contention
  3699         -	$as_echo "#define USE_THREAD_ALLOC 1" >>confdefs.h
  3700         -
  3701         -    else
  3702         -	TCL_THREADS=0
  3703         -	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
  3704         -$as_echo "no" >&6; }
  3705         -    fi
  3706         -
  3707   3671   
  3708   3672   
  3709   3673   #------------------------------------------------------------------------
  3710   3674   # Embedded configuration information, encoding to use for the values, TIP #59
  3711   3675   #------------------------------------------------------------------------
  3712   3676   
  3713   3677   

Changes to win/configure.ac.

    74     74   #--------------------------------------------------------------------
    75     75   # Determines the correct binary file extension (.o, .obj, .exe etc.)
    76     76   #--------------------------------------------------------------------
    77     77   
    78     78   AC_OBJEXT
    79     79   AC_EXEEXT
    80     80   
    81         -#--------------------------------------------------------------------
    82         -# Check whether --enable-threads or --disable-threads was given.
    83         -#--------------------------------------------------------------------
    84         -
    85         -SC_ENABLE_THREADS
    86         -
    87     81   #------------------------------------------------------------------------
    88     82   # Embedded configuration information, encoding to use for the values, TIP #59
    89     83   #------------------------------------------------------------------------
    90     84   
    91     85   SC_TCL_CFG_ENCODING
    92     86   
    93     87   #--------------------------------------------------------------------

Changes to win/rules.vc.

   726    726   !if [nmakehlp -f $(OPTS) "staticpkg"] && $(STATIC_BUILD)
   727    727   !message *** Doing staticpkg
   728    728   TCL_USE_STATIC_PACKAGES	= 1
   729    729   !else
   730    730   TCL_USE_STATIC_PACKAGES	= 0
   731    731   !endif
   732    732   
   733         -!if [nmakehlp -f $(OPTS) "nothreads"]
   734         -!message *** Compile explicitly for non-threaded tcl
   735         -TCL_THREADS	= 0
   736         -USE_THREAD_ALLOC= 0
   737         -!else
   738         -TCL_THREADS	= 1
   739         -USE_THREAD_ALLOC= 1
   740         -!endif
   741         -
   742    733   !if [nmakehlp -f $(OPTS) "symbols"]
   743    734   !message *** Doing symbols
   744    735   DEBUG		= 1
   745    736   !else
   746    737   DEBUG		= 0
   747    738   !endif
   748    739   
................................................................................
   770    761   PGO		= 0
   771    762   !endif
   772    763   
   773    764   !if [nmakehlp -f $(OPTS) "loimpact"]
   774    765   !message *** Warning: ignoring option "loimpact" - deprecated on modern Windows.
   775    766   !endif
   776    767   
   777         -# TBD - should get rid of this option
   778         -!if [nmakehlp -f $(OPTS) "thrdalloc"]
   779         -!message *** Doing thrdalloc
   780         -USE_THREAD_ALLOC = 1
   781         -!endif
   782         -
   783    768   !if [nmakehlp -f $(OPTS) "tclalloc"]
   784    769   USE_THREAD_ALLOC = 0
   785    770   !endif
   786    771   
   787    772   !if [nmakehlp -f $(OPTS) "unchecked"]
   788    773   !message *** Doing unchecked
   789    774   UNCHECKED = 1
................................................................................
   966    951   ################################################################
   967    952   # 10. Construct output directory and file paths
   968    953   # Figure-out how to name our intermediate and output directories.
   969    954   # In order to avoid inadvertent mixing of object files built using
   970    955   # different compilers, build configurations etc.,
   971    956   #
   972    957   # Naming convention (suffixes):
   973         -#   t = full thread support.
          958  +#   t = full thread support. (Not used for Tcl >= 8.7)
   974    959   #   s = static library (as opposed to an import library)
   975    960   #   g = linked to the debug enabled C run-time.
   976    961   #   x = special static build when it links to the dynamic C run-time.
   977    962   #
   978    963   # The following macros are set in this section:
   979    964   # SUFX - the suffix to use for binaries based on above naming convention
   980    965   # BUILDDIRTOP - the toplevel default output directory
................................................................................
  1024   1009   EXT	    = lib
  1025   1010   !if !$(MSVCRT)
  1026   1011   TMP_DIRFULL = $(TMP_DIRFULL:X=)
  1027   1012   SUFX	    = $(SUFX:x=)
  1028   1013   !endif
  1029   1014   !endif
  1030   1015   
  1031         -!if !$(TCL_THREADS)
         1016  +!if !$(TCL_THREADS) || $(TCL_VERSION) > 86
  1032   1017   TMP_DIRFULL = $(TMP_DIRFULL:Threaded=)
  1033   1018   SUFX	    = $(SUFX:t=)
  1034   1019   !endif
  1035   1020   
  1036   1021   !ifndef TMP_DIR
  1037   1022   TMP_DIR	    = $(TMP_DIRFULL)
  1038   1023   !ifndef OUT_DIR
................................................................................
  1075   1060   
  1076   1061   !if $(TCLINSTALL) # Building against an installed Tcl
  1077   1062   
  1078   1063   # When building extensions, we need to locate tclsh. Depending on version
  1079   1064   # of Tcl we are building against, this may or may not have a "t" suffix.
  1080   1065   # Try various possibilities in turn.
  1081   1066   TCLSH		= $(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe
  1082         -!if !exist("$(TCLSH)") && $(TCL_THREADS)
  1083         -TCLSH           = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)t$(SUFX).exe
  1084         -!endif
  1085   1067   !if !exist("$(TCLSH)")
  1086   1068   TCLSH           = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX:t=).exe
  1087   1069   !endif
  1088   1070   
  1089   1071   TCLSTUBLIB	= $(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib
  1090   1072   TCLIMPLIB	= $(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib
  1091   1073   # When building extensions, may be linking against Tcl that does not add
................................................................................
  1098   1080   TCLDDELIB	= $(_TCLDIR)\lib\tcldde14$(SUFX:t=).lib
  1099   1081   TCLTOOLSDIR	= \must\have\tcl\sources\to\build\this\target
  1100   1082   TCL_INCLUDES    = -I"$(_TCLDIR)\include"
  1101   1083   
  1102   1084   !else # Building against Tcl sources
  1103   1085   
  1104   1086   TCLSH		= $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX).exe
  1105         -!if !exist($(TCLSH)) && $(TCL_THREADS)
  1106         -TCLSH		= $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)t$(SUFX).exe
  1107         -!endif
  1108   1087   !if !exist($(TCLSH))
  1109   1088   TCLSH		= $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX:t=).exe
  1110   1089   !endif
  1111   1090   TCLSTUBLIB	= $(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib
  1112   1091   TCLIMPLIB	= $(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX).lib
  1113   1092   # When building extensions, may be linking against Tcl that does not add
  1114   1093   # "t" suffix (e.g. 8.5 or 8.7). If lib not found check for that possibility.
................................................................................
  1260   1239   
  1261   1240   !if $(TCL_MEM_DEBUG)
  1262   1241   OPTDEFINES	= $(OPTDEFINES) -DTCL_MEM_DEBUG
  1263   1242   !endif
  1264   1243   !if $(TCL_COMPILE_DEBUG)
  1265   1244   OPTDEFINES	= $(OPTDEFINES) -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS
  1266   1245   !endif
  1267         -!if $(TCL_THREADS)
         1246  +!if $(TCL_THREADS) && $(TCL_VERSION) < 86
  1268   1247   OPTDEFINES	= $(OPTDEFINES) -DTCL_THREADS=1
  1269   1248   !if $(USE_THREAD_ALLOC)
  1270   1249   OPTDEFINES	= $(OPTDEFINES) -DUSE_THREAD_ALLOC=1
  1271   1250   !endif
  1272   1251   !endif
  1273   1252   !if $(STATIC_BUILD)
  1274   1253   OPTDEFINES	= $(OPTDEFINES) -DSTATIC_BUILD
................................................................................
  1704   1683   !if $(CONFIG_CHECK)
  1705   1684   !ifdef TCLNMAKECONFIG
  1706   1685   !include $(TCLNMAKECONFIG)
  1707   1686   
  1708   1687   !if defined(CORE_MACHINE) && "$(CORE_MACHINE)" != "$(MACHINE)"
  1709   1688   !error ERROR: Build target ($(MACHINE)) does not match the Tcl library architecture ($(CORE_MACHINE)).
  1710   1689   !endif
  1711         -!if defined(CORE_USE_THREAD_ALLOC) && $(CORE_USE_THREAD_ALLOC) != $(USE_THREAD_ALLOC)
  1712         -!message WARNING: Value of USE_THREAD_ALLOC ($(USE_THREAD_ALLOC)) does not match its Tcl core value ($(CORE_USE_THREAD_ALLOC)).
  1713         -!endif
  1714   1690   !if defined(CORE_DEBUG) && $(CORE_DEBUG) != $(DEBUG)
  1715   1691   !message WARNING: Value of DEBUG ($(DEBUG)) does not match its Tcl library configuration ($(DEBUG)).
  1716   1692   !endif
  1717   1693   !endif
  1718   1694   
  1719   1695   !endif # TCLNMAKECONFIG
  1720   1696   

Changes to win/tcl.m4.

   378    378       else
   379    379   	AC_MSG_RESULT([static])
   380    380   	SHARED_BUILD=0
   381    381   	AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?])
   382    382       fi
   383    383   ])
   384    384   
   385         -#------------------------------------------------------------------------
   386         -# SC_ENABLE_THREADS --
   387         -#
   388         -#	Specify if thread support should be enabled
   389         -#
   390         -# Arguments:
   391         -#	none
   392         -#
   393         -# Results:
   394         -#
   395         -#	Adds the following arguments to configure:
   396         -#		--enable-threads=yes|no
   397         -#
   398         -#	Defines the following vars:
   399         -#		TCL_THREADS
   400         -#------------------------------------------------------------------------
   401         -
   402         -AC_DEFUN([SC_ENABLE_THREADS], [
   403         -    AC_MSG_CHECKING(for building with threads)
   404         -    AC_ARG_ENABLE(threads, [  --enable-threads        build with threads (default: on)],
   405         -	[tcl_ok=$enableval], [tcl_ok=yes])
   406         -
   407         -    if test "$tcl_ok" = "yes"; then
   408         -	AC_MSG_RESULT([yes (default)])
   409         -	TCL_THREADS=1
   410         -	AC_DEFINE(TCL_THREADS)
   411         -	# USE_THREAD_ALLOC tells us to try the special thread-based
   412         -	# allocator that significantly reduces lock contention
   413         -	AC_DEFINE(USE_THREAD_ALLOC)
   414         -    else
   415         -	TCL_THREADS=0
   416         -	AC_MSG_RESULT(no)
   417         -    fi
   418         -    AC_SUBST(TCL_THREADS)
   419         -])
   420         -
   421    385   #------------------------------------------------------------------------
   422    386   # SC_ENABLE_SYMBOLS --
   423    387   #
   424    388   #	Specify if debugging symbols should be used.
   425    389   #	Memory (TCL_MEM_DEBUG) and compile (TCL_COMPILE_DEBUG) debugging
   426    390   #	can also be enabled.
   427    391   #

Changes to win/tcl.rc.

     3      3   
     4      4   #include <winver.h>
     5      5   #include <tcl.h>
     6      6   
     7      7   //
     8      8   // build-up the name suffix that defines the type of build this is.
     9      9   //
    10         -#if TCL_THREADS
    11         -#define SUFFIX_THREADS	    "t"
    12         -#else
    13         -#define SUFFIX_THREADS	    ""
    14         -#endif
    15         -
    16     10   #if DEBUG && !UNCHECKED
    17     11   #define SUFFIX_DEBUG	    "g"
    18     12   #else
    19     13   #define SUFFIX_DEBUG	    ""
    20     14   #endif
    21     15   
    22         -#define SUFFIX		    SUFFIX_THREADS SUFFIX_DEBUG
           16  +#define SUFFIX		    SUFFIX_DEBUG
    23     17   
    24     18   
    25     19   LANGUAGE 0x9, 0x1	/* LANG_ENGLISH, SUBLANG_DEFAULT */
    26     20   
    27     21   VS_VERSION_INFO VERSIONINFO
    28     22    FILEVERSION 	TCL_MAJOR_VERSION,TCL_MINOR_VERSION,TCL_RELEASE_LEVEL,TCL_RELEASE_SERIAL
    29     23    PRODUCTVERSION TCL_MAJOR_VERSION,TCL_MINOR_VERSION,TCL_RELEASE_LEVEL,TCL_RELEASE_SERIAL

Changes to win/tclsh.rc.

     4      4   
     5      5   #include <winver.h>
     6      6   #include <tcl.h>
     7      7   
     8      8   //
     9      9   // build-up the name suffix that defines the type of build this is.
    10     10   //
    11         -#if TCL_THREADS
    12         -#define SUFFIX_THREADS	    "t"
    13         -#else
    14         -#define SUFFIX_THREADS	    ""
    15         -#endif
    16         -
    17     11   #if STATIC_BUILD
    18     12   #define SUFFIX_STATIC	    "s"
    19     13   #else
    20     14   #define SUFFIX_STATIC	    ""
    21     15   #endif
    22     16   
    23     17   #if DEBUG && !UNCHECKED
    24     18   #define SUFFIX_DEBUG	    "g"
    25     19   #else
    26     20   #define SUFFIX_DEBUG	    ""
    27     21   #endif
    28     22   
    29         -#define SUFFIX		    SUFFIX_THREADS SUFFIX_STATIC SUFFIX_DEBUG
           23  +#define SUFFIX		    SUFFIX_STATIC SUFFIX_DEBUG
    30     24   
    31     25   
    32     26   LANGUAGE 0x9, 0x1	/* LANG_ENGLISH, SUBLANG_DEFAULT */
    33     27   
    34     28   VS_VERSION_INFO VERSIONINFO
    35     29    FILEVERSION 	TCL_MAJOR_VERSION,TCL_MINOR_VERSION,TCL_RELEASE_LEVEL,TCL_RELEASE_SERIAL
    36     30    PRODUCTVERSION TCL_MAJOR_VERSION,TCL_MINOR_VERSION,TCL_RELEASE_LEVEL,TCL_RELEASE_SERIAL