git: 430367e06a49 - main - net/py-mpi4py: Fix building with Flang

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Wed, 10 Dec 2025 16:30:00 UTC
The branch main has been updated by arrowd:

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

commit 430367e06a493f6ec32704416cd07ecf1f416114
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2025-12-10 16:27:02 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2025-12-10 16:27:02 +0000

    net/py-mpi4py: Fix building with Flang
---
 net/py-mpi4py/Makefile | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/net/py-mpi4py/Makefile b/net/py-mpi4py/Makefile
index 461123f4032e..2f896e6ba0b3 100644
--- a/net/py-mpi4py/Makefile
+++ b/net/py-mpi4py/Makefile
@@ -23,7 +23,6 @@ CONFLICTS_INSTALL=	${PYTHON_PKGNAMEPREFIX}mpi4py-mpich-4*
 MPIOPTIONS=		--oversubscribe --stream-buffering 0
 .elif ${MP} == "MPICH"
 USES+=			fortran mpi:mpich
-LDFLAGS+=		${LOCALBASE}/lib/gcc${GCC_DEFAULT}/libgcc_s.so
 CONFLICTS_INSTALL=	${PYTHON_PKGNAMEPREFIX}mpi4py-4*
 MPIOPTIONS=
 .else
@@ -36,6 +35,12 @@ PORTDOCS=	*
 
 OPTIONS_DEFINE=	DOCS
 
+.include <bsd.port.pre.mk>
+
+.if ${FORTRAN_DEFAULT} == gfortran
+LDFLAGS+=	${LOCALBASE}/lib/gcc${GCC_DEFAULT}/libgcc_s.so
+.endif
+
 pre-configure:
 	${CP} ${FILESDIR}/mpi.cfg ${WRKSRC}/
 	${REINPLACE_CMD} -e 's|%%LOCALBASE%%/mpi/openmpi|${MPI_HOME}|'	\
@@ -52,4 +57,4 @@ post-install:
 do-test:
 	(cd ${WRKSRC} && ${MPIEXEC} ${MPIOPTIONS} -n 5 ${PYTHON_CMD} test/main.py)
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>