git: 859322ed609a - main - science/cdf: Fix building with Flang

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Sat, 06 Sep 2025 16:02:23 UTC
The branch main has been updated by arrowd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=859322ed609ac146d9d8e6a8a122057a21cd5e1a

commit 859322ed609ac146d9d8e6a8a122057a21cd5e1a
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2025-09-06 16:01:57 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2025-09-06 16:02:17 +0000

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

diff --git a/science/cdf/Makefile b/science/cdf/Makefile
index edc94cf929c9..f1b4b8b150c5 100644
--- a/science/cdf/Makefile
+++ b/science/cdf/Makefile
@@ -23,7 +23,6 @@ MAKE_FLAGS=	INSTALLDIR=${STAGEDIR}${PREFIX} OS=freebsd ENV=gnu \
 		FORTRAN=yes FC_freebsd=${F77}
 MAKE_JOBS_UNSAFE=	yes
 TEST_TARGET=	test  # XXX: test segfaults
-FFLAGS+=	-std=legacy
 
 WRKSRC=		${WRKDIR}/cdf${VER}-dist
 SUB_FILES=	pkg-message
@@ -37,6 +36,12 @@ OPTIONS_DEFINE=	DOCS EXAMPLES
 
 MAKE_ARGS+=	OS=freebsd ENV=gnu all
 
+.include <bsd.port.pre.mk>
+
+.if ${FORTRAN_DEFAULT} != flang
+FFLAGS=		-std=legacy
+.endif
+
 post-patch:
 .for def in ${DEFS}
 	@${REINPLACE_CMD} -e 's|<path>|${PREFIX}|' \
@@ -51,4 +56,4 @@ post-install:
 	${SED} -i '' 's,${STAGEDIR},,g' ${STAGEDIR}${PREFIX}/bin/definitions.?
 	${RM} -f ${STAGEDIR}${PREFIX}/CDFLeapSeconds.txt
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>