git: f1b6b49a6ab2 - main - Mk/Uses/tcl.mk: provide two additional variables to help with Tcl9

From: Pietro Cerutti <gahr_at_FreeBSD.org>
Date: Wed, 16 Oct 2024 09:45:24 UTC
The branch main has been updated by gahr:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f1b6b49a6ab2faa4ce6190ef75db08f433cab235

commit f1b6b49a6ab2faa4ce6190ef75db08f433cab235
Author:     Pietro Cerutti <gahr@FreeBSD.org>
AuthorDate: 2024-10-16 09:43:42 +0000
Commit:     Pietro Cerutti <gahr@FreeBSD.org>
CommitDate: 2024-10-16 09:45:22 +0000

    Mk/Uses/tcl.mk: provide two additional variables to help with Tcl9
    
    These define prefixes for shared libraries and postfixes for stub
    libraries when building TEA-based extensions against Tcl 8 or Tcl 9.
---
 Mk/Uses/tcl.mk | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/Mk/Uses/tcl.mk b/Mk/Uses/tcl.mk
index dd9b7d842d83..0a3b470ea0ce 100644
--- a/Mk/Uses/tcl.mk
+++ b/Mk/Uses/tcl.mk
@@ -12,6 +12,13 @@
 #
 # TCL_INCLUDEDIR	- Path where the Tcl C headers can be found
 #
+# TCL_PKG_LIB_PREFIX    - Library prefix, as per TIP595. This is tcl9 when
+#			  when building against Tcl 9.0, and empty otherwise
+#
+# TCL_PKG_STUB_POSTFIX  - Stub library postfix. This is empty when building
+#			  against Tcl 9.0, and DISTVERSION otherwise.
+#			  See https://core.tcl-lang.org/tclconfig/info/381985d331b96ba9
+#
 #
 # TK_VER		- Major.Minor version of Tk
 #
@@ -216,7 +223,15 @@ LIB_DEPENDS+=	${_TCLTK_LIB_LINE}
 .  if ${tcl_ARGS:Mtea}
 GNU_CONFIGURE=	yes
 TCL_PKG?=	${PORTNAME:C/^tcl(-?)//:C/(-?)tcl\$//}${PORTVERSION}
-PLIST_SUB+=	TCL_PKG=${TCL_PKG}
+.    if ${TCL_VER} == "9.0"
+TCL_PKG_LIB_PREFIX=	tcl9
+TCL_PKG_STUB_POSTFIX=	
+.    else
+TCL_PKG_LIB_PREFIX=	
+TCL_PKG_STUB_POSTFIX=	${DISTVERSION}
+.    endif
+PLIST_SUB+=	TCL_PKG=${TCL_PKG} TCL_PKG_LIB_PREFIX=${TCL_PKG_LIB_PREFIX} \
+		TCL_PKG_STUB_POSTFIX=${TCL_PKG_STUB_POSTFIX}
 CONFIGURE_ARGS+=--exec-prefix=${PREFIX} \
 		--with-tcl=${TCL_LIBDIR} \
 		--with-tclinclude=${TCL_INCLUDEDIR}