aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authortijl <tijl@FreeBSD.org>2013-12-13 21:22:32 +0800
committertijl <tijl@FreeBSD.org>2013-12-13 21:22:32 +0800
commit0f7d7e47b93edd068aeadccd0c95173e323a588d (patch)
tree5df47dd039279010c812141045a2914b4b3e6787 /Mk
parentbf06cc5e66d2a1a94acb304d9f566c67d85f707f (diff)
downloadfreebsd-ports-gnome-0f7d7e47b93edd068aeadccd0c95173e323a588d.tar.gz
freebsd-ports-gnome-0f7d7e47b93edd068aeadccd0c95173e323a588d.tar.zst
freebsd-ports-gnome-0f7d7e47b93edd068aeadccd0c95173e323a588d.zip
New USES=fortran to replace USE_FORTRAN.
USE_FORTRAN=yes can be replaced with USES=fortran or USES=fortran:gcc. USE_FORTRAN=ifort can be replaced with USES=fortran:ifort. USE_FORTRAN=f77 is deprecated and the version of gcc it depends on (lang/gcc34) is scheduled to be removed. Note that USE_FORTRAN=yes also makes GCC the C/C++ compiler while USES=fortran only sets the Fortran compiler and can be used together with Clang as C/C++ compiler.
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Uses/fortran.mk39
1 files changed, 39 insertions, 0 deletions
diff --git a/Mk/Uses/fortran.mk b/Mk/Uses/fortran.mk
new file mode 100644
index 000000000000..f86b37d6ec06
--- /dev/null
+++ b/Mk/Uses/fortran.mk
@@ -0,0 +1,39 @@
+# $FreeBSD$
+#
+# Fortran support
+#
+# MAINTAINER: fortran@FreeBSD.org
+#
+# Feature: fortran
+# Usage: USES=fortran
+# Valid ARGS: gcc (default), ifort
+
+.if !defined(_INCLUDE_USES_FORTRAN_MK)
+_INCLUDE_USES_FORTRAN_MK= yes
+
+.if !defined(fortran_ARGS)
+fortran_ARGS= gcc
+.endif
+
+.if ${fortran_ARGS} == gcc
+_GCC_VER= 46
+BUILD_DEPENDS+= gfortran${_GCC_VER}:${PORTSDIR}/lang/gcc
+RUN_DEPENDS+= gfortran${_GCC_VER}:${PORTSDIR}/lang/gcc
+USE_BINUTILS= yes
+F77= gfortran${_GCC_VER}
+FC= gfortran${_GCC_VER}
+FFLAGS+= -Wl,-rpath=${LOCALBASE}/lib/gcc${_GCC_VER}
+LDFLAGS+= -Wl,-rpath=${LOCALBASE}/lib/gcc${_GCC_VER}
+.elif ${fortran_ARGS} == ifort
+BUILD_DEPENDS+= ${LOCALBASE}/intel_fc_80/bin/ifort:${PORTSDIR}/lang/ifc
+RUN_DEPENDS+= ${LOCALBASE}/intel_fc_80/bin/ifort:${PORTSDIR}/lang/ifc
+F77= ${LOCALBASE}/intel_fc_80/bin/ifort
+FC= ${LOCALBASE}/intel_fc_80/bin/ifort
+.else
+IGNORE= USES=fortran: invalid arguments: ${fortran_ARGS}
+.endif
+
+CONFIGURE_ENV+= F77="${F77}" FC="${FC}" FFLAGS="${FFLAGS}"
+MAKE_ENV+= F77="${F77}" FC="${FC}" FFLAGS="${FFLAGS}"
+
+.endif