2013-12-13 13:22:32 +00:00
|
|
|
# Fortran support
|
|
|
|
#
|
|
|
|
# Feature: fortran
|
|
|
|
# Usage: USES=fortran
|
2022-09-30 20:13:26 +00:00
|
|
|
# Valid ARGS: gfortran
|
2014-03-15 10:31:54 +00:00
|
|
|
#
|
|
|
|
# MAINTAINER: fortran@FreeBSD.org
|
2013-12-13 13:22:32 +00:00
|
|
|
|
|
|
|
.if !defined(_INCLUDE_USES_FORTRAN_MK)
|
|
|
|
_INCLUDE_USES_FORTRAN_MK= yes
|
|
|
|
|
2022-04-24 10:00:20 +00:00
|
|
|
. if empty(fortran_ARGS)
|
2017-11-18 13:09:56 +00:00
|
|
|
fortran_ARGS= ${FORTRAN_DEFAULT}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
2013-12-13 13:22:32 +00:00
|
|
|
|
2022-09-30 20:13:26 +00:00
|
|
|
. if ${fortran_ARGS} == gfortran
|
2014-02-26 22:42:58 +00:00
|
|
|
_GCC_VER= ${GCC_DEFAULT:S/.//}
|
2016-03-27 01:23:25 +00:00
|
|
|
BUILD_DEPENDS+= gfortran${_GCC_VER}:lang/gcc${_GCC_VER}
|
|
|
|
RUN_DEPENDS+= gfortran${_GCC_VER}:lang/gcc${_GCC_VER}
|
2013-12-13 13:22:32 +00:00
|
|
|
F77= gfortran${_GCC_VER}
|
|
|
|
FC= gfortran${_GCC_VER}
|
|
|
|
FFLAGS+= -Wl,-rpath=${LOCALBASE}/lib/gcc${_GCC_VER}
|
2014-02-16 17:15:31 +00:00
|
|
|
FCFLAGS+= -Wl,-rpath=${LOCALBASE}/lib/gcc${_GCC_VER}
|
2013-12-20 16:33:59 +00:00
|
|
|
LDFLAGS+= -Wl,-rpath=${LOCALBASE}/lib/gcc${_GCC_VER} \
|
2014-02-26 11:44:49 +00:00
|
|
|
-L${LOCALBASE}/lib/gcc${_GCC_VER} -B${LOCALBASE}/bin
|
2022-04-24 10:00:20 +00:00
|
|
|
. else
|
2013-12-13 13:22:32 +00:00
|
|
|
IGNORE= USES=fortran: invalid arguments: ${fortran_ARGS}
|
2022-04-24 10:00:20 +00:00
|
|
|
. endif
|
2013-12-13 13:22:32 +00:00
|
|
|
|
2017-10-24 19:13:01 +00:00
|
|
|
USE_BINUTILS= yes
|
2014-02-16 17:15:31 +00:00
|
|
|
CONFIGURE_ENV+= F77="${F77}" FC="${FC}" FFLAGS="${FFLAGS}" FCFLAGS="${FCFLAGS}"
|
|
|
|
MAKE_ENV+= F77="${F77}" FC="${FC}" FFLAGS="${FFLAGS}" FCFLAGS="${FCFLAGS}"
|
2013-12-13 13:22:32 +00:00
|
|
|
|
|
|
|
.endif
|