tech-pkg archive

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

Re: compiler/

On 2020-02-19 11:19, Greg Troxel wrote:
Jason Bacon <> writes:

I think matching base means a value of 5, not 5.5, because these
versions omit the point release number.   4.8.x is like 5.x, as I
understand it.
Right, the version specified in the .mk file would only include major
version if > 4.x.

My only concern is whether the package point release always matches
the base compiler, but I think matching the major version is an
improvement in any case over base GCC 5.5 + gfortran 4.8.
Fair enough concern, but we do not have multiple point releases of gcc
in pkgsrc, so there is no real possibility to match.
Here's what I came up with as a first-attempt.  Comments welcome...

--- 22 Aug 2018 20:48:37 -0000      1.10
+++ 21 Feb 2020 19:30:31 -0000
@@ -33,7 +33,14 @@

 .include "../../mk/"

+# If pkgsrc base compiler is GCC, match the gfortran requirement as closely as +# possible.  Otherwise, default to a mainstream version and hope for the best. +# If base compiler is clang/llvm, we really should use flang rather than gfortran.
+.if ${PKGSRC_COMPILER} == gcc
+GFORTRAN_VERSION?=     ${CC_VERSION:C/.[0-9].[0-9]$//:S/gcc-//}

 .if !empty(PKGPATH:Mlang/gcc${GFORTRAN_VERSION}) || !empty(PKGPATH:Mdevel/patch) || \

Home | Main Index | Thread Index | Old Index