ports/109082: [PATCH] improved threads support for Mk/bsd.tcl.mk
Martin Matuska
martin at matuska.org
Mon Feb 12 12:20:14 UTC 2007
>Number: 109082
>Category: ports
>Synopsis: [PATCH] improved threads support for Mk/bsd.tcl.mk
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Mon Feb 12 12:20:13 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator: Martin Matuska
>Release: FreeBSD 6.2-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD 6.2-RELEASE amd64/i386
>Description:
Improved threads support for bsd.tcl.mk
>How-To-Repeat:
>Fix:
--- Mk/bsd.tcl.mk.orig Mon Feb 12 10:30:50 2007
+++ Mk/bsd.tcl.mk Mon Feb 12 12:13:00 2007
@@ -13,9 +13,9 @@
# different TCL versions the version can be specified directly.
# If version is not specified (USE_TCL=yes) then the latest
# version is used (8.4 currently).
-# Available values are: 85, 85-thread, 84, 84-thread, 83, 82,
-# 81 and 80.
+# Available values are: 85, 84, 83, 82, 81 and 80.
# USE_TCL_BUILD - Build time dependency on tcl. Same semantics as USE_TCL.
+# USE_TCL_THREADS - If set, a threaded build of TCL is required.
#
# USE_TK - Depend on tk to run. In case of incompatible APIs of different
# TK versions the version can be specified directly. If version
@@ -49,7 +49,23 @@
.if defined(USE_TCL) || defined(USE_TCL_BUILD)
-_TCL_VERSIONS= 85 85-thread 84 84-thread 83 82 81 80
+_TCL_VERSIONS= 85 84 84 83 82 81 80
+_TCL_THREADED_VERSIONS= 85 84 81
+
+# Support for obsolete 84-thread and 85-thread definitions
+.if defined(USE_TCL)
+. if ${USE_TCL} == "84-thread" || ${USE_TCL} == "85-thread"
+USE_TCL= ${USE_TCL:S/-thread//}
+USE_TCL_THREADS= yes
+. endif
+.endif
+
+.if defined(USE_TCL_BUILD)
+. if ${USE_TCL_BUILD} == "84-thread" || ${USE_TCL_BUILD} == "85-thread"
+USE_TCL_BUILD= ${USE_TCL_BUILD:S/-thread//}
+USE_TCL_THREADS= yes
+. endif
+.endif
.if defined(USE_TCL)
_RUN= yes
@@ -60,26 +76,36 @@
_BUILD= yes
.endif
+
.if ${USE_TCL} == "yes"
USE_TCL= 84
.endif
-TCL_VER:= ${USE_TCL:S/8/8./:S/-thread//}
+TCL_VER:= ${USE_TCL:S/8/8./}
# Special case
.if ${USE_TCL} == "81"
-USE_TCL= tcl81-thread
+USE_TCL_THREADS= yes
+.endif
+
+# Check if a tcl build with threads is required
+.if defined(USE_TCL_THREADS)
+_TCL_THREADED= _THREADED
+_TCL_THREADED_PORT= -thread
+_TCL_THREADED_IGNORE= (with threads)
.endif
_FOUND= no
-.for ver in ${_TCL_VERSIONS}
+
+_FOUND= no
+.for ver in ${_TCL${_TCL_THREADED}_VERSIONS}
. if ${USE_TCL} == "${ver}"
_FOUND= yes
. if defined(_BUILD)
-BUILD_DEPENDS+= tclsh${TCL_VER}:${PORTSDIR}/lang/tcl${USE_TCL}
+BUILD_DEPENDS+= tclsh${TCL_VER}:${PORTSDIR}/lang/tcl${USE_TCL}${_TCL_THREADED_PORT}
. endif
. if defined(_RUN)
-RUN_DEPENDS+= tclsh${TCL_VER}:${PORTSDIR}/lang/tcl${USE_TCL}
+RUN_DEPENDS+= tclsh${TCL_VER}:${PORTSDIR}/lang/tcl${USE_TCL}${_TCL_THREADED_PORT}
. endif
TCL_INCLUDEDIR= ${LOCALBASE}/include/tcl${TCL_VER}
TCL_LIBDIR= ${LOCALBASE}/lib/tcl${TCL_VER}
@@ -88,8 +114,16 @@
.endfor
.if ${_FOUND} == "no"
-IGNORE= Unknown TCL version specified: ${USE_TCL}
+IGNORE= Unknown TCL version specified: ${USE_TCL} ${_TCL_THREADED_IGNORE}
.endif
+
+.if defined(USE_TCL_THREADS) && exists(${TCLSH})
+TCL_THREADED!= echo 'puts [array names tcl_platform -exact threaded]' | ${TCLSH} || return 0
+. if empty(TCL_THREADED)
+IGNORE= TCL ${TCL_VER} with threads required. The installed version does not support threads
+. endif
+.endif
+
.endif # defined(USE_TCL) || defined(USE_TCL_BUILD)
.if defined(USE_TK) || defined(USE_TK_BUILD)
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list