Index: Mk/Uses/tcl.mk =================================================================== --- Mk/Uses/tcl.mk +++ Mk/Uses/tcl.mk @@ -58,14 +58,14 @@ # # MAINTAINER: tcltk@FreeBSD.org -.if ${USES:Mtk} || ${USES:Mtk\:*} -.if !defined(_TCLTK_PORT) -_TCLTK_IGNORE= yes -.endif -.endif +# +# _TCLTK_PORT tells us whether we're depending on Tcl or Tk. When using +# USES+=tk, the included file tk.mk sets this before including this file. +# +_TCLTK_PORT?= tcl -.if !defined(_INCLUDE_USES_TCL_MK) && !defined(_TCLTK_IGNORE) -_INCLUDE_USES_TCL_MK= yes +.if !defined(_INCLUDE_USES_${_TCLTK_PORT}_MK) && !defined(_TCLTK_IGNORE) +_INCLUDE_USES_${_TCLTK_PORT}_MK= yes # # List the currently available versions. @@ -85,12 +85,6 @@ .endif # -# _TCLTK_PORT tells us whether we're depending on Tcl or Tk. When using -# USES+=tk, the included file tk.mk sets this before including this file. -# -_TCLTK_PORT?= tcl - -# # Parse a ver+ argument. # .if ${tcl_ARGS:M*+} @@ -170,28 +164,27 @@ # # Dependencies # -_TCLTK_BUILD_DEPENDS= -_TCLTK_RUN_DEPENDS= -_TCLTK_LIB_DEPENDS= # Construct the correct dependency lines (wrapper) .if ${tcl_ARGS:Mwrapper} . if ${_TCLTK_PORT} == "tcl" -_TCLTK_WRAPPER_PORT= tclsh:lang/tcl-wrapper +_TCLTK_WRAPPER_PORT+= tclsh:lang/tcl-wrapper . elif ${_TCLTK_PORT} == "tk" -_TCLTK_WRAPPER_PORT= wish:x11-toolkits/tk-wrapper +_TCLTK_WRAPPER_PORT+= wish:x11-toolkits/tk-wrapper . endif .endif # Construct the correct dependency lines (Tcl/Tk) . if ${_TCLTK_PORT} == "tcl" -_TCLTK_EXE_LINE= tclsh${TCL_VER}:lang/tcl${_TCLTK_WANTED_VERSION} -_TCLTK_LIB_LINE= libtcl${TCL_SHLIB_VER}.so:lang/tcl${_TCLTK_WANTED_VERSION} +_TCLTK_EXE_LINE+= tclsh${TCL_VER}:lang/tcl${_TCLTK_WANTED_VERSION} +_TCLTK_LIB_LINE+= libtcl${TCL_SHLIB_VER}.so:lang/tcl${_TCLTK_WANTED_VERSION} . elif ${_TCLTK_PORT} == "tk" -_TCLTK_EXE_LINE= wish${TK_VER}:x11-toolkits/tk${_TCLTK_WANTED_VERSION} -_TCLTK_LIB_LINE= libtk${TK_SHLIB_VER}.so:x11-toolkits/tk${_TCLTK_WANTED_VERSION} +_TCLTK_EXE_LINE+= wish${TK_VER}:x11-toolkits/tk${_TCLTK_WANTED_VERSION} +_TCLTK_LIB_LINE+= libtk${TK_SHLIB_VER}.so:x11-toolkits/tk${_TCLTK_WANTED_VERSION} .endif +.if defined(_INCLUDE_USES_tcl_MK) && !defined(_INCLUDE_USES_tk_MK) || \ + defined(_INCLUDE_USES_tk_MK) && !defined(_INCLUDE_USES_tcl_MK) .if ${tcl_ARGS:Mbuild} BUILD_DEPENDS+= ${_TCLTK_WRAPPER_PORT} \ ${_TCLTK_EXE_LINE} @@ -202,6 +195,7 @@ RUN_DEPENDS+= ${_TCLTK_WRAPPER_PORT} LIB_DEPENDS+= ${_TCLTK_LIB_LINE} .endif +.endif # Setup TEA stuff .if ${tcl_ARGS:Mtea} @@ -216,6 +210,7 @@ . endif .endif -.endif # defined(_INCLUDE_USES_TCL_MK) +.endif # defined(_INCLUDE_USES_tcl/tk_MK) .undef _TCLTK_IGNORE +.undef _TCLTK_PORT