Index: Mk/Uses/tcl.mk =================================================================== --- Mk/Uses/tcl.mk (revision 328031) +++ Mk/Uses/tcl.mk (working copy) @@ -48,6 +48,8 @@ # - 84+, 85+, 86+ - Depend on any installed version greater or equal to # the specified version. # +# - -84, -85, -86 - Mark a specific version as invalid +# # If wrapper is specified, an additional dependency on tcl-wrapper or # tk-wrapper is added. It is NOT possible to select a specific version of # Tcl/Tk when using the wrapper. @@ -84,6 +86,16 @@ _TCLTK_WANTED_VERSION:= ${_TCL_ARGS:M8[4-6]} .endif +.if ${_TCL_ARGS:M-8[4-6]} +# if an invalid version is specified, remove the invalid +# versions from the valid versions, and set the default +# version to the highest valid version +_TCLTK_VALID_VERSIONS:= ${_TCLTK_VALID_VERSIONS:N${_TCL_ARGS:M-8[4-6]:S/-//g}} +. for _v in ${_TCLTK_VALID_VERSIONS} +_TCLTK_DEFAULT_VERSION:= ${_v} +. endfor +.endif + .if ${_TCL_ARGS:Mwrapper} && defined(_TCLTK_WANTED_VERSION) IGNORE= USES=${_TCLTK_PORT}: it is not possible to specify both a version and the wrapper: ${tcl_ARGS} .endif @@ -92,14 +104,10 @@ _TCLTK_WANTED_VERSION= ${_TCLTK_DEFAULT_VERSION} .endif -# check that the specified ver+ is valid -.if ! ${_TCLTK_VALID_VERSIONS:M${_TCLTK_WANTED_VERSION}} -IGNORE= USES=${_TCLTK_PORT}: incorrect ${_TCLTK_PORT} version specified: ${_TCLTK_WANTED_VERSION} -.endif - +# resolve minimum versions .if defined(_TCLTK_MIN_VERSION) . for _v in ${_TCLTK_VALID_VERSIONS} -. if ${_TCLTK_MIN_VERSION} < ${_v} || !exists(${LOCALBASE}/lib/lib${_TCLTK_PORT}${_v}.so) +. if ${_TCLTK_MIN_VERSION} > ${_v} || !exists(${LOCALBASE}/lib/lib${_TCLTK_PORT}${_v}.so) . else _TCLTK_WANTED_VERSION= ${_v} . endif @@ -106,6 +114,11 @@ . endfor .endif +# check that the resolved wanted version is valid +.if ! ${_TCLTK_VALID_VERSIONS:M${_TCLTK_WANTED_VERSION}} +IGNORE= USES=${_TCLTK_PORT}: incorrect ${_TCLTK_PORT} version specified: ${_TCLTK_WANTED_VERSION} +.endif + # # Exported variables #