1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-08 06:48:28 +00:00

Mk/Uses/fortran.mk: Add flang as a non-default USES=fortran argument. Note,

flang is currently only available for amd64.

PR:		220313
Submitted by:	yuri@rawbw.com
Reviewed by:	db, jmd, mat, swills
Approved by:	portmgr
Differential Revision:	https://reviews.freebsd.org/D12529
This commit is contained in:
Joseph Mingrone 2017-10-24 19:13:01 +00:00
parent 06ef9fa33e
commit f1d9274286
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=452811

View File

@ -4,7 +4,7 @@
#
# Feature: fortran
# Usage: USES=fortran
# Valid ARGS: gcc (default)
# Valid ARGS: flang, gcc (default)
#
# MAINTAINER: fortran@FreeBSD.org
@ -15,11 +15,20 @@ _INCLUDE_USES_FORTRAN_MK= yes
fortran_ARGS= gcc
.endif
.if ${fortran_ARGS} == gcc
.if ${fortran_ARGS} == flang
.if ${ARCH} == amd64
BUILD_DEPENDS+= flang:devel/flang
RUN_DEPENDS+= flang:devel/flang
F77= flang
FC= flang
LDFLAGS+= -L${LOCALBASE}/flang/lib -lflang -lexecinfo
.else
IGNORE= USES=fortran: flang argument only available for amd64
.endif
.elif ${fortran_ARGS} == gcc
_GCC_VER= ${GCC_DEFAULT:S/.//}
BUILD_DEPENDS+= gfortran${_GCC_VER}:lang/gcc${_GCC_VER}
RUN_DEPENDS+= gfortran${_GCC_VER}:lang/gcc${_GCC_VER}
USE_BINUTILS= yes
F77= gfortran${_GCC_VER}
FC= gfortran${_GCC_VER}
FFLAGS+= -Wl,-rpath=${LOCALBASE}/lib/gcc${_GCC_VER}
@ -30,6 +39,7 @@ LDFLAGS+= -Wl,-rpath=${LOCALBASE}/lib/gcc${_GCC_VER} \
IGNORE= USES=fortran: invalid arguments: ${fortran_ARGS}
.endif
USE_BINUTILS= yes
CONFIGURE_ENV+= F77="${F77}" FC="${FC}" FFLAGS="${FFLAGS}" FCFLAGS="${FCFLAGS}"
MAKE_ENV+= F77="${F77}" FC="${FC}" FFLAGS="${FFLAGS}" FCFLAGS="${FCFLAGS}"