git: 7c66e4fef49f - main - games/megaglest: unbreak on -CURRENT i386

From: Fernando Apesteguía <fernape_at_FreeBSD.org>
Date: Wed, 29 Mar 2023 12:51:00 UTC
The branch main has been updated by fernape:

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

commit 7c66e4fef49f10053e6a9c844baf312b1a148a52
Author:     Thibault Payet <monwarez@mailoo.org>
AuthorDate: 2023-03-29 07:21:07 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2023-03-29 12:46:24 +0000

    games/megaglest: unbreak on -CURRENT i386
    
    PR:             270265
    Reported by:    monwarez@mailoo.org (maintainer)
---
 games/megaglest/Makefile | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/games/megaglest/Makefile b/games/megaglest/Makefile
index 7452be6ff2f6..5dd2f1fe3c36 100644
--- a/games/megaglest/Makefile
+++ b/games/megaglest/Makefile
@@ -49,6 +49,16 @@ VIEWER_CMAKE_BOOL=	BUILD_MEGAGLEST_MODEL_IMPORT_EXPORT_TOOLS \
 			BUILD_MEGAGLEST_MODEL_VIEWER
 VIEWER_USE=		WX=3.0
 
+.include <bsd.port.pre.mk>
+
+# The following is actually meant for lld 15.0 and later, but the ports
+# framework does not support LINKER_TYPE and LINKER_VERSION yet.
+.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 150
+# Turn off checking of dynamic relocations, to avoid lld diagnostics about
+# possibly incorrect addend values.
+LDFLAGS_i386+=	-Wl,--no-check-dynamic-relocations
+.endif
+
 post-patch:
 	@${REINPLACE_CMD} -e 's,/usr/local/include/lua51,${LUA_INCDIR},g ; \
 		s,/usr/local/lib/lua51,${LUA_LIBDIR},g ; \
@@ -78,4 +88,4 @@ do-install-VIEWER-on:
 	${INSTALL_PROGRAM} ${WRKSRC}/source/g3d_viewer/megaglest_g3dviewer ${STAGEDIR}${PREFIX}/bin/megaglest_g3dviewer
 	${INSTALL_DATA} ${WRKSRC}/mk/shared/g3dviewer.ico ${STAGEDIR}${PREFIX}/share/pixmaps/
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>