pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Using native gfortran on linux





On 22/01/2026 03:14, Ryo ONODERA wrote:
It seems that pkgsrc/mk/compiler/gcc.mk is too simplified.
I thin that the following patch should be readded.


Yeah, Thomas pointed out the same in direct email.

Reversing it does fix my problem.

What I think this fragment is supposed to be saying is

On NetBSD systems (except the very old ones that had a fortran in base) or if _USE_PKGSRC_GCC=YES then include compiler/${PKGSRC_FORTRAN}.mk

though I'm not totally convinced that's exactly what it is doing, and as I mentioned earlier in this thread its going to need modifying to deal with gfortran in recent NetBSD-current anyway.

cheers
mark

Index: gcc.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/compiler/gcc.mk,v
retrieving revision 1.307
diff -u -r1.307 gcc.mk
--- gcc.mk	18 Jan 2026 21:08:07 -0000	1.307
+++ gcc.mk	21 Jan 2026 14:12:51 -0000
@@ -1351,7 +1351,19 @@
  # On systems without a Fortran compiler, pull one in if needed.
  PKGSRC_FORTRAN?=gfortran
-.include "../../mk/compiler/${PKGSRC_FORTRAN}.mk"
+_GCC_NEEDS_A_FORTRAN=	no
+.if empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) && !(defined(FCPATH) && exists(${FCPATH}))
+_GCC_NEEDS_A_FORTRAN=	yes
+.else
+.  for _pattern_ in 0.* 1.[0-4] 1.[0-4].*
+.    if !empty(MACHINE_PLATFORM:MNetBSD-${_pattern_}-*)
+_GCC_NEEDS_A_FORTRAN=	yes
+.    endif
+.  endfor
+.endif
+.if !empty(_GCC_NEEDS_A_FORTRAN:M[yY][eE][sS])
+.  include "../../mk/compiler/${PKGSRC_FORTRAN}.mk"
+.endif
#.READONLY: GCC_REQD
  _GCC_REQD_EFFECTIVE:=	${GCC_REQD}

Thank you.


Home | Main Index | Thread Index | Old Index