Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Feb 2023 04:49:44 GMT
From:      Mikhail Teterin <mi@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 089fb698f23c - main - devel/tcl-trf: fix fatal compiler warning
Message-ID:  <202302100449.31A4nicJ089194@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202302100449.31A4nicJ089194>