From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Feb 12 12:20:14 2007 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93BA516A420 for ; Mon, 12 Feb 2007 12:20:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 7268F13C4C8 for ; Mon, 12 Feb 2007 12:20:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l1CCKEoY006145 for ; Mon, 12 Feb 2007 12:20:14 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l1CCKELE006144; Mon, 12 Feb 2007 12:20:14 GMT (envelope-from gnats) Resent-Date: Mon, 12 Feb 2007 12:20:14 GMT Resent-Message-Id: <200702121220.l1CCKELE006144@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Martin Matuska Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A3E6416A408 for ; Mon, 12 Feb 2007 12:15:56 +0000 (UTC) (envelope-from rebum@mail.vx.sk) Received: from mail.vx.sk (neo.vx.sk [88.198.35.14]) by mx1.freebsd.org (Postfix) with ESMTP id 3659313C471 for ; Mon, 12 Feb 2007 12:15:56 +0000 (UTC) (envelope-from rebum@mail.vx.sk) Received: from localhost (localhost [127.0.0.1]) by mail.vx.sk (Postfix) with ESMTP id B00813F449 for ; Mon, 12 Feb 2007 13:15:54 +0100 (CET) Received: from mail.vx.sk ([127.0.0.1]) by localhost (mail.vx.sk [127.0.0.1]) (amavisd-new, port 10024) with LMTP id zbS8R1+RAX5B for ; Mon, 12 Feb 2007 13:15:51 +0100 (CET) Received: by mail.vx.sk (Postfix, from userid 1001) id BA0B43F458; Mon, 12 Feb 2007 13:15:51 +0100 (CET) Message-Id: <20070212121551.BA0B43F458@mail.vx.sk> Date: Mon, 12 Feb 2007 13:15:51 +0100 (CET) From: Martin Matuska To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/109082: [PATCH] improved threads support for Mk/bsd.tcl.mk X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2007 12:20:14 -0000 >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: