Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jul 2023 18:17:41 GMT
From:      Raphael Kubo da Costa <rakuco@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 8e012871f3f0 - main - net-p2p/amule: Disable C++17 error about usage of the register keyword
Message-ID:  <202307111817.36BIHfQV022665@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by rakuco:

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

commit 8e012871f3f019d9dcd56ee288c84fb85bb0171d
Author:     Raphael Kubo da Costa <rakuco@FreeBSD.org>
AuthorDate: 2023-07-11 18:14:00 +0000
Commit:     Raphael Kubo da Costa <rakuco@FreeBSD.org>
CommitDate: 2023-07-11 18:14:00 +0000

    net-p2p/amule: Disable C++17 error about usage of the register keyword
    
    Instead of forcing the port to build with -std=c++11 in all FreeBSD
    versions, just pass -Wno-register when the port is being built with a
    Clang release that defaults to C++17 mode (which does not have the
    register keyword by default).
    
    Approved by:    eduardo (maintainer)
    Differential Revision:  https://reviews.freebsd.org/D40939
---
 net-p2p/amule/Makefile | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/net-p2p/amule/Makefile b/net-p2p/amule/Makefile
index 775074c776ba..eaf9f659b12f 100644
--- a/net-p2p/amule/Makefile
+++ b/net-p2p/amule/Makefile
@@ -16,10 +16,6 @@ LIB_DEPENDS=	libcryptopp.so:security/cryptopp
 
 USES=		bison compiler:c++11-lang cpe desktop-file-utils gmake \
 		localbase:ldflags perl5 pkgconfig shebangfix tar:xz
-# amule 2.3.3 does not work with C++17 which is the default since
-# clang 16. This can be removed once that port starts working with C++17 and
-# has its own USE_CXXSTD removed.
-USE_CXXSTD=	c++11
 USE_PERL5=	build
 USE_WX=		3.0
 WX_CONF_ARGS=	absolute
@@ -122,4 +118,13 @@ post-patch-DOCS-off:
 post-install-FILEVIEW-on:
 	${INSTALL_PROGRAM} ${WRKSRC}/src/utils/fileview/mulefileview ${STAGEDIR}${PREFIX}/bin
 
-.include <bsd.port.mk>
+.include <bsd.port.pre.mk>
+
+# amule 2.3.3 does not work with C++17 which is the default since clang
+# 16. Change the defaults and allow the `register' keyword to be used without
+# triggering a compiler error to allow the build to work.
+.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 160
+CXXFLAGS+=	-Wno-register
+.endif
+
+.include <bsd.port.post.mk>



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