TEA (tclconfig) Source Code

Check-in [4e2ab62998]
Login

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
Timelines: family | ancestors | descendants | both | practcl
Files: files | file ages | folders
SHA3-256: 4e2ab6299813c803e1b4c2e485a418276743cc22f05a869eb2df569ed0c4a9c5
User & Date: hypnotoad 2018-10-01 21:33:15.077
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
Unified Diff Ignore Whitespace Patch
Changes to tcl.m4.
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932




933
934








935
936
937
938
939
940
941

942
943
944
945
946
947
948
949

950
951
952
953
954
955
956
#		TCL_THREADS
#		_REENTRANT
#		_THREAD_SAFE
#------------------------------------------------------------------------

AC_DEFUN([TEA_ENABLE_THREADS], [
    AC_ARG_ENABLE(threads,
	AC_HELP_STRING([--enable-threads],
	    [build with threads (default: on)]),
	[tcl_ok=$enableval], [tcl_ok=yes])

    if test "${enable_threads+set}" = set; then
	enableval="$enable_threads"
	tcl_ok=$enableval
    else
	tcl_ok=yes
    fi

    if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
	TCL_THREADS=1

	if test "${TEA_PLATFORM}" != "windows" ; then
	    # We are always OK on Windows, so check what this platform wants:

	    # USE_THREAD_ALLOC tells us to try the special thread-based
	    # allocator that significantly reduces lock contention
	    AC_DEFINE(USE_THREAD_ALLOC, 1,
		[Do we want to use the threaded memory allocator?])
	    AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
	    if test "`uname -s`" = "SunOS" ; then
		AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
			[Do we really want to follow the standard? Yes we do!])
	    fi
	    AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?])
	    AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
	    if test "$tcl_ok" = "no"; then
		# Check a little harder for __pthread_mutex_init in the same
		# library, as some systems hide it there until pthread.h is
		# defined.  We could alternatively do an AC_TRY_COMPILE with
		# pthread.h, but that will work with libpthread really doesn't
		# exist, like AIX 4.2.  [Bug: 4359]
		AC_CHECK_LIB(pthread, __pthread_mutex_init,
		    tcl_ok=yes, tcl_ok=no)
	    fi

	    if test "$tcl_ok" = "yes"; then
		# The space is needed
		THREADS_LIBS=" -lpthread"
	    else
		AC_CHECK_LIB(pthreads, pthread_mutex_init,
		    tcl_ok=yes, tcl_ok=no)
		if test "$tcl_ok" = "yes"; then
		    # The space is needed
		    THREADS_LIBS=" -lpthreads"
		else
		    AC_CHECK_LIB(c, pthread_mutex_init,
			tcl_ok=yes, tcl_ok=no)
		    if test "$tcl_ok" = "no"; then
			AC_CHECK_LIB(c_r, pthread_mutex_init,
			    tcl_ok=yes, tcl_ok=no)
			if test "$tcl_ok" = "yes"; then
			    # The space is needed
			    THREADS_LIBS=" -pthread"
			else
			    TCL_THREADS=0
			    AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled])
			fi
		    fi
		fi
	    fi
	fi
    else
	TCL_THREADS=0
    fi
    # Do checking message here to not mess up interleaved configure output
    AC_MSG_CHECKING([for building with threads])
    if test "${TCL_THREADS}" = 1; then
	AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?])
	AC_MSG_RESULT([yes (default)])
    else
	AC_MSG_RESULT([no])
    fi
    # TCL_THREADS sanity checking.  See if our request for building with
    # threads is the same as the way Tcl was built.  If not, warn the user.




    case ${TCL_DEFS} in
	*THREADS=1*)








	    if test "${TCL_THREADS}" = "0"; then
		AC_MSG_WARN([
    Building ${PACKAGE_NAME} without threads enabled, but building against Tcl
    that IS thread-enabled.  It is recommended to use --enable-threads.])
	    fi
	    ;;
	*)

	    if test "${TCL_THREADS}" = "1"; then
		AC_MSG_WARN([
    --enable-threads requested, but building against a Tcl that is NOT
    thread-enabled.  This is an OK configuration that will also run in
    a thread-enabled core.])
	    fi
	    ;;
    esac

    AC_SUBST(TCL_THREADS)
])

#------------------------------------------------------------------------
# TEA_ENABLE_SYMBOLS --
#
#	Specify if debugging symbols should be used.







|
|
|


|
|

|



|

|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|




|
|

|



>
>
>
>
|
|
>
>
>
>
>
>
>
>
|
|


|
<
<
>
|
|



|
<
<
>







849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951


952
953
954
955
956
957
958


959
960
961
962
963
964
965
966
#		TCL_THREADS
#		_REENTRANT
#		_THREAD_SAFE
#------------------------------------------------------------------------

AC_DEFUN([TEA_ENABLE_THREADS], [
    AC_ARG_ENABLE(threads,
        AC_HELP_STRING([--enable-threads],
            [build with threads (default: on)]),
        [tcl_ok=$enableval], [tcl_ok=yes])

    if test "${enable_threads+set}" = set; then
        enableval="$enable_threads"
        tcl_ok=$enableval
    else
        tcl_ok=yes
    fi

    if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
        TCL_THREADS=1

        if test "${TEA_PLATFORM}" != "windows" ; then
            # We are always OK on Windows, so check what this platform wants:

            # USE_THREAD_ALLOC tells us to try the special thread-based
            # allocator that significantly reduces lock contention
            AC_DEFINE(USE_THREAD_ALLOC, 1,
                [Do we want to use the threaded memory allocator?])
            AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
            if test "`uname -s`" = "SunOS" ; then
                AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
                        [Do we really want to follow the standard? Yes we do!])
            fi
            AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?])
            AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
            if test "$tcl_ok" = "no"; then
                # Check a little harder for __pthread_mutex_init in the same
                # library, as some systems hide it there until pthread.h is
                # defined.  We could alternatively do an AC_TRY_COMPILE with
                # pthread.h, but that will work with libpthread really doesn't
                # exist, like AIX 4.2.  [Bug: 4359]
                AC_CHECK_LIB(pthread, __pthread_mutex_init,
                    tcl_ok=yes, tcl_ok=no)
            fi

            if test "$tcl_ok" = "yes"; then
                # The space is needed
                THREADS_LIBS=" -lpthread"
            else
                AC_CHECK_LIB(pthreads, pthread_mutex_init,
                    tcl_ok=yes, tcl_ok=no)
                if test "$tcl_ok" = "yes"; then
                    # The space is needed
                    THREADS_LIBS=" -lpthreads"
                else
                    AC_CHECK_LIB(c, pthread_mutex_init,
                        tcl_ok=yes, tcl_ok=no)
                    if test "$tcl_ok" = "no"; then
                        AC_CHECK_LIB(c_r, pthread_mutex_init,
                            tcl_ok=yes, tcl_ok=no)
                        if test "$tcl_ok" = "yes"; then
                            # The space is needed
                            THREADS_LIBS=" -pthread"
                        else
                            TCL_THREADS=0
                            AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled])
                        fi
                    fi
                fi
            fi
        fi
    else
        TCL_THREADS=0
    fi
    # Do checking message here to not mess up interleaved configure output
    AC_MSG_CHECKING([for building with threads])
    if test "${TCL_THREADS}" = 1; then
        AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?])
        AC_MSG_RESULT([yes (default)])
    else
        AC_MSG_RESULT([no])
    fi
    # TCL_THREADS sanity checking.  See if our request for building with
    # threads is the same as the way Tcl was built.  If not, warn the user.

    if test "${TCL_VERSION}" > "8.6" ; then
      TCL_HAS_THREADS=1
    else
      case ${TCL_DEFS} in
          *THREADS=1*)
              TCL_HAS_THREADS=1;
          ;;
          *)
              TCL_HAS_THREADS=0;
          ;;
      esac
    fi
    if test "${TCL_HAS_THREADS}" = "1"; then
      if test "${TCL_THREADS}" = "0"; then
        AC_MSG_WARN([
    Building ${PACKAGE_NAME} without threads enabled, but building against Tcl
    that IS thread-enabled.  It is recommended to use --enable-threads.])
      fi


    else
      if test "${TCL_THREADS}" = "1"; then
        AC_MSG_WARN([
    --enable-threads requested, but building against a Tcl that is NOT
    thread-enabled.  This is an OK configuration that will also run in
    a thread-enabled core.])
      fi


    fi
    AC_SUBST(TCL_THREADS)
])

#------------------------------------------------------------------------
# TEA_ENABLE_SYMBOLS --
#
#	Specify if debugging symbols should be used.