TEA (tclconfig) Source Code

Check-in [4e2ab62998]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:Modifications to skip threading checks (that no longer work) for tcl 8.7+ and just assume threading for the purposes of comparing what the package wants.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | practcl
Files: files | file ages | folders
SHA3-256: 4e2ab6299813c803e1b4c2e485a418276743cc22f05a869eb2df569ed0c4a9c5
User & Date: hypnotoad 2018-10-01 21:33:15
Context
2018-10-24
02:49
Removing windows line breaks check-in: 3daecc999e user: hypnotoad tags: practcl
2018-10-01
21:33
Modifications to skip threading checks (that no longer work) for tcl 8.7+ and just assume threading for the purposes of comparing what the package wants. check-in: 4e2ab62998 user: hypnotoad tags: practcl
2018-09-24
14:16
Pulling changes from TEA check-in: 72a7e44a99 user: hypnotoad tags: practcl
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tcl.m4.

   849    849   #		TCL_THREADS
   850    850   #		_REENTRANT
   851    851   #		_THREAD_SAFE
   852    852   #------------------------------------------------------------------------
   853    853   
   854    854   AC_DEFUN([TEA_ENABLE_THREADS], [
   855    855       AC_ARG_ENABLE(threads,
   856         -	AC_HELP_STRING([--enable-threads],
   857         -	    [build with threads (default: on)]),
   858         -	[tcl_ok=$enableval], [tcl_ok=yes])
          856  +        AC_HELP_STRING([--enable-threads],
          857  +            [build with threads (default: on)]),
          858  +        [tcl_ok=$enableval], [tcl_ok=yes])
   859    859   
   860    860       if test "${enable_threads+set}" = set; then
   861         -	enableval="$enable_threads"
   862         -	tcl_ok=$enableval
          861  +        enableval="$enable_threads"
          862  +        tcl_ok=$enableval
   863    863       else
   864         -	tcl_ok=yes
          864  +        tcl_ok=yes
   865    865       fi
   866    866   
   867    867       if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
   868         -	TCL_THREADS=1
   869         -
   870         -	if test "${TEA_PLATFORM}" != "windows" ; then
   871         -	    # We are always OK on Windows, so check what this platform wants:
   872         -
   873         -	    # USE_THREAD_ALLOC tells us to try the special thread-based
   874         -	    # allocator that significantly reduces lock contention
   875         -	    AC_DEFINE(USE_THREAD_ALLOC, 1,
   876         -		[Do we want to use the threaded memory allocator?])
   877         -	    AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
   878         -	    if test "`uname -s`" = "SunOS" ; then
   879         -		AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
   880         -			[Do we really want to follow the standard? Yes we do!])
   881         -	    fi
   882         -	    AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?])
   883         -	    AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
   884         -	    if test "$tcl_ok" = "no"; then
   885         -		# Check a little harder for __pthread_mutex_init in the same
   886         -		# library, as some systems hide it there until pthread.h is
   887         -		# defined.  We could alternatively do an AC_TRY_COMPILE with
   888         -		# pthread.h, but that will work with libpthread really doesn't
   889         -		# exist, like AIX 4.2.  [Bug: 4359]
   890         -		AC_CHECK_LIB(pthread, __pthread_mutex_init,
   891         -		    tcl_ok=yes, tcl_ok=no)
   892         -	    fi
   893         -
   894         -	    if test "$tcl_ok" = "yes"; then
   895         -		# The space is needed
   896         -		THREADS_LIBS=" -lpthread"
   897         -	    else
   898         -		AC_CHECK_LIB(pthreads, pthread_mutex_init,
   899         -		    tcl_ok=yes, tcl_ok=no)
   900         -		if test "$tcl_ok" = "yes"; then
   901         -		    # The space is needed
   902         -		    THREADS_LIBS=" -lpthreads"
   903         -		else
   904         -		    AC_CHECK_LIB(c, pthread_mutex_init,
   905         -			tcl_ok=yes, tcl_ok=no)
   906         -		    if test "$tcl_ok" = "no"; then
   907         -			AC_CHECK_LIB(c_r, pthread_mutex_init,
   908         -			    tcl_ok=yes, tcl_ok=no)
   909         -			if test "$tcl_ok" = "yes"; then
   910         -			    # The space is needed
   911         -			    THREADS_LIBS=" -pthread"
   912         -			else
   913         -			    TCL_THREADS=0
   914         -			    AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled])
   915         -			fi
   916         -		    fi
   917         -		fi
   918         -	    fi
   919         -	fi
   920         -    else
   921         -	TCL_THREADS=0
          868  +        TCL_THREADS=1
          869  +
          870  +        if test "${TEA_PLATFORM}" != "windows" ; then
          871  +            # We are always OK on Windows, so check what this platform wants:
          872  +
          873  +            # USE_THREAD_ALLOC tells us to try the special thread-based
          874  +            # allocator that significantly reduces lock contention
          875  +            AC_DEFINE(USE_THREAD_ALLOC, 1,
          876  +                [Do we want to use the threaded memory allocator?])
          877  +            AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
          878  +            if test "`uname -s`" = "SunOS" ; then
          879  +                AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
          880  +                        [Do we really want to follow the standard? Yes we do!])
          881  +            fi
          882  +            AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?])
          883  +            AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
          884  +            if test "$tcl_ok" = "no"; then
          885  +                # Check a little harder for __pthread_mutex_init in the same
          886  +                # library, as some systems hide it there until pthread.h is
          887  +                # defined.  We could alternatively do an AC_TRY_COMPILE with
          888  +                # pthread.h, but that will work with libpthread really doesn't
          889  +                # exist, like AIX 4.2.  [Bug: 4359]
          890  +                AC_CHECK_LIB(pthread, __pthread_mutex_init,
          891  +                    tcl_ok=yes, tcl_ok=no)
          892  +            fi
          893  +
          894  +            if test "$tcl_ok" = "yes"; then
          895  +                # The space is needed
          896  +                THREADS_LIBS=" -lpthread"
          897  +            else
          898  +                AC_CHECK_LIB(pthreads, pthread_mutex_init,
          899  +                    tcl_ok=yes, tcl_ok=no)
          900  +                if test "$tcl_ok" = "yes"; then
          901  +                    # The space is needed
          902  +                    THREADS_LIBS=" -lpthreads"
          903  +                else
          904  +                    AC_CHECK_LIB(c, pthread_mutex_init,
          905  +                        tcl_ok=yes, tcl_ok=no)
          906  +                    if test "$tcl_ok" = "no"; then
          907  +                        AC_CHECK_LIB(c_r, pthread_mutex_init,
          908  +                            tcl_ok=yes, tcl_ok=no)
          909  +                        if test "$tcl_ok" = "yes"; then
          910  +                            # The space is needed
          911  +                            THREADS_LIBS=" -pthread"
          912  +                        else
          913  +                            TCL_THREADS=0
          914  +                            AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled])
          915  +                        fi
          916  +                    fi
          917  +                fi
          918  +            fi
          919  +        fi
          920  +    else
          921  +        TCL_THREADS=0
   922    922       fi
   923    923       # Do checking message here to not mess up interleaved configure output
   924    924       AC_MSG_CHECKING([for building with threads])
   925    925       if test "${TCL_THREADS}" = 1; then
   926         -	AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?])
   927         -	AC_MSG_RESULT([yes (default)])
          926  +        AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?])
          927  +        AC_MSG_RESULT([yes (default)])
   928    928       else
   929         -	AC_MSG_RESULT([no])
          929  +        AC_MSG_RESULT([no])
   930    930       fi
   931    931       # TCL_THREADS sanity checking.  See if our request for building with
   932    932       # threads is the same as the way Tcl was built.  If not, warn the user.
   933         -    case ${TCL_DEFS} in
   934         -	*THREADS=1*)
   935         -	    if test "${TCL_THREADS}" = "0"; then
   936         -		AC_MSG_WARN([
          933  +
          934  +    if test "${TCL_VERSION}" > "8.6" ; then
          935  +      TCL_HAS_THREADS=1
          936  +    else
          937  +      case ${TCL_DEFS} in
          938  +          *THREADS=1*)
          939  +              TCL_HAS_THREADS=1;
          940  +          ;;
          941  +          *)
          942  +              TCL_HAS_THREADS=0;
          943  +          ;;
          944  +      esac
          945  +    fi
          946  +    if test "${TCL_HAS_THREADS}" = "1"; then
          947  +      if test "${TCL_THREADS}" = "0"; then
          948  +        AC_MSG_WARN([
   937    949       Building ${PACKAGE_NAME} without threads enabled, but building against Tcl
   938    950       that IS thread-enabled.  It is recommended to use --enable-threads.])
   939         -	    fi
   940         -	    ;;
   941         -	*)
   942         -	    if test "${TCL_THREADS}" = "1"; then
   943         -		AC_MSG_WARN([
          951  +      fi
          952  +    else
          953  +      if test "${TCL_THREADS}" = "1"; then
          954  +        AC_MSG_WARN([
   944    955       --enable-threads requested, but building against a Tcl that is NOT
   945    956       thread-enabled.  This is an OK configuration that will also run in
   946    957       a thread-enabled core.])
   947         -	    fi
   948         -	    ;;
   949         -    esac
          958  +      fi
          959  +    fi
   950    960       AC_SUBST(TCL_THREADS)
   951    961   ])
   952    962   
   953    963   #------------------------------------------------------------------------
   954    964   # TEA_ENABLE_SYMBOLS --
   955    965   #
   956    966   #	Specify if debugging symbols should be used.