Index: math/R/Makefile
===================================================================
--- math/R/Makefile	(revision 444603)
+++ math/R/Makefile	(working copy)
@@ -23,7 +23,7 @@
 GNU_CONFIGURE=		yes
 INSTALL_TARGET=		install-strip
 ONLY_FOR_ARCHS=		amd64 i386
-USES=			fortran gmake iconv libtool localbase objc:compiler \
+USES=			gmake iconv libtool localbase objc:compiler \
 			pathfix perl5 readline
 
 USE_PERL5=		build
@@ -32,8 +32,9 @@
 OPTIONS_GROUP=		NEEDGCC NEEDX11
 OPTIONS_GROUP_NEEDGCC=	LTO OPENMP
 OPTIONS_GROUP_NEEDX11=	GHOSTSCRIPT JPEG CAIROPANGO PNG TCLTK TEXDOCS TIFF
-OPTIONS_SINGLE=		BLAS
+OPTIONS_SINGLE=		BLAS FORTRAN
 OPTIONS_SINGLE_BLAS=	ATLAS OPENBLAS NETLIB RBLAS
+OPTIONS_SINGLE_FORTRAN=	GFORTRAN FLANG
 
 OPTIONS_SUB=		YES
 
@@ -56,9 +57,11 @@
 RPROF_DESC=		R profiling via Rprof()
 TEXDOCS_DESC=		Build/Install TeX-dependent documentation files
 X11_DESC=		X11 graphics device
+GFORTRAN_DESC=		gfortran based on gcc
+FLANG_DESC=		flang based on llvm/clang
 
 OPTIONS_DEFAULT=	CAIROPANGO GHOSTSCRIPT ICU INFO JPEG LDOUBLE LIBR PNG \
-			RBLAS RPROF TCLTK TIFF X11
+			RBLAS RPROF TCLTK TIFF X11 FLANG
 
 ATLAS_USES=		blaslapack:atlas
 ATLAS_CONFIGURE_ON=	--disable-BLAS-shlib
@@ -118,6 +121,8 @@
 TIFF_CONFIGURE_WITH=	libtiff
 X11_CONFIGURE_WITH=	x
 X11_USE=		xorg=ice,sm,x11,xext,xmu,xscrnsaver,xt
+GFORTRAN_USES=		fortran:gcc
+FLANG_USES=		fortran:flang
 
 post-patch:
 	@${REINPLACE_CMD} -e "s|/usr/local|${LOCALBASE}|g" ${WRKSRC}/configure
Index: math/R/files/patch-configure
===================================================================
--- math/R/files/patch-configure	(nonexistent)
+++ math/R/files/patch-configure	(working copy)
@@ -0,0 +1,10 @@
+--- configure.orig	2017-04-19 21:38:22 UTC
++++ configure
+@@ -7528,6 +7528,7 @@ if test $ac_compiler_gnu = yes; then
+ else
+   G77=
+ fi
++G77=yes
+ ac_ext=c
+ ac_cpp='$CPP $CPPFLAGS'
+ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'

Property changes on: math/R/files/patch-configure
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: math/R/files/patch-src_main_complex.c
===================================================================
--- math/R/files/patch-src_main_complex.c	(nonexistent)
+++ math/R/files/patch-src_main_complex.c	(working copy)
@@ -0,0 +1,20 @@
+--- src/main/complex.c.orig	2017-03-27 22:15:12 UTC
++++ src/main/complex.c
+@@ -133,7 +133,7 @@ static double complex mycpow (double com
+     } else if (yi == 0.0 && yr == (k = (int) yr) && abs(k) <= 65536)
+ 	Z = R_cpow_n(X, k);
+     else
+-#ifdef HAVE_CPOW
++#if defined(HAVE_CPOW) && !defined(__FreeBSD__)
+ 	Z = cpow(X, Y);
+ #else
+     {
+@@ -365,7 +365,7 @@ void attribute_hidden z_prec_r(Rcomplex 
+    Currently (Feb 2011) they are used on FreeBSD.
+ */
+ 
+-#ifndef HAVE_CLOG
++#if !defined(HAVE_CLOG) || defined(__FreeBSD__)
+ #define clog R_clog
+ /* FIXME: maybe add full IEC60559 support */
+ static double complex clog(double complex x)

Property changes on: math/R/files/patch-src_main_complex.c
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property