git: 089fb698f23c - main - devel/tcl-trf: fix fatal compiler warning

From: Mikhail Teterin <mi_at_FreeBSD.org>
Date: Fri, 10 Feb 2023 04:49:44 UTC
The branch main has been updated by mi:

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

commit 089fb698f23c450dfc221ed099e57768644eb156
Author:     Mikhail Teterin <mi@FreeBSD.org>
AuthorDate: 2023-02-10 04:44:56 +0000
Commit:     Mikhail Teterin <mi@FreeBSD.org>
CommitDate: 2023-02-10 04:44:56 +0000

    devel/tcl-trf: fix fatal compiler warning
    
    Starting with version 15 clang includes the new -Wdeprecated-non-prototype
    in -Wall. This warns, when a K&R-style function-definitions follow
    ANSI function-declarations. And TCL code has LOTS of K&R definitions...
    
    The warning is poorly worded -- and, in my opinion, outright bogus,
    but the ports need to keep building, so I'm using a trick borrowed
    from src/share/mk/sys.mk to conditionally disable it.
---
 devel/tcl-trf/Makefile | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/devel/tcl-trf/Makefile b/devel/tcl-trf/Makefile
index 5902242f165d..7055435b6b56 100644
--- a/devel/tcl-trf/Makefile
+++ b/devel/tcl-trf/Makefile
@@ -17,7 +17,7 @@ LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
 
 TEST_DEPENDS=	${LOCALBASE}/lib/Memchan2.3/libMemchan.so.1:devel/tcl-memchan
 
-USES+=		tcl:tea tar:bzip2
+USES+=		tcl:tea tar:bzip2 compiler
 USE_LDCONFIG=	${PREFIX}/lib/Trf
 DDIR=		${PREFIX}/lib/tcl${TCL_VER}/Trf
 CFLAGS+=	-Wall -Werror
@@ -27,6 +27,7 @@ MAKE_ENV+=	INSTALL_DATA="${INSTALL_DATA}"
 REINPLACE_ARGS=	-i ""
 CONFIGURE_ARGS+=--enable-static-zlib --enable-static-bzlib \
 		--enable-static-md5
+CONFIGURE_ENV+=	CC=${CC}
 
 do-install:
 	${MKDIR} ${STAGEDIR}${PREFIX}/lib/Trf
@@ -44,4 +45,10 @@ do-test:
 
 PLIST_SUB+=	TCL_DVER=${TCL_VER:C/\.//} VER=${PORTVERSION}
 
-.include <bsd.port.mk>
+.include <bsd.port.pre.mk>
+
+.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 150
+CFLAGS+=	-Wno-deprecated-non-prototype
+.endif
+
+.include <bsd.port.post.mk>