Sat Nov 4 12:50:06 2023 UTC ()
gfortran.mk: Change fallback version from 7 to 10

gfortran.mk has code to choose the version of gfortran (really, the
version of pkgsrc gcc from which to use gfortran), and the first plan
is to match the gcc version in use.  Only if that version is not
available does it use a fallback version.  That used to be 7, back
when 7 was the standard relatively modern approach.  Today, 10 is the
standard approach for reasonably-up-to-date but not super-new gcc.

As proposed on tech-pkg on with no objections.


(gdt)
diff -r1.25 -r1.26 pkgsrc/mk/compiler/gfortran.mk

cvs diff -r1.25 -r1.26 pkgsrc/mk/compiler/gfortran.mk (expand / switch to unified diff)

--- pkgsrc/mk/compiler/gfortran.mk 2023/10/31 13:47:56 1.25
+++ pkgsrc/mk/compiler/gfortran.mk 2023/11/04 12:50:06 1.26
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: gfortran.mk,v 1.25 2023/10/31 13:47:56 gdt Exp $ 1# $NetBSD: gfortran.mk,v 1.26 2023/11/04 12:50:06 gdt Exp $
2# 2#
3# Copyright (c) 2005 The NetBSD Foundation, Inc. 3# Copyright (c) 2005 The NetBSD Foundation, Inc.
4# All rights reserved. 4# All rights reserved.
5# 5#
6# This code is derived from software contributed to The NetBSD Foundation 6# This code is derived from software contributed to The NetBSD Foundation
7# by Johnny C. Lam. 7# by Johnny C. Lam.
8# 8#
9# Redistribution and use in source and binary forms, with or without 9# Redistribution and use in source and binary forms, with or without
10# modification, are permitted provided that the following conditions 10# modification, are permitted provided that the following conditions
11# are met: 11# are met:
12# 1. Redistributions of source code must retain the above copyright 12# 1. Redistributions of source code must retain the above copyright
13# notice, this list of conditions and the following disclaimer. 13# notice, this list of conditions and the following disclaimer.
14# 2. Redistributions in binary form must reproduce the above copyright 14# 2. Redistributions in binary form must reproduce the above copyright
@@ -49,32 +49,32 @@ GFORTRAN_VERSION?= 12 @@ -49,32 +49,32 @@ GFORTRAN_VERSION?= 12
49# selected (historical current only?), advance to 10. 49# selected (historical current only?), advance to 10.
50.if !empty(POSSIBLE_GFORTRAN_VERSION:M9) && \ 50.if !empty(POSSIBLE_GFORTRAN_VERSION:M9) && \
51 !empty(MACHINE_PLATFORM:MNetBSD-*-aarch64*) 51 !empty(MACHINE_PLATFORM:MNetBSD-*-aarch64*)
52POSSIBLE_GFORTRAN_VERSION= 10 52POSSIBLE_GFORTRAN_VERSION= 10
53.endif 53.endif
54 54
55# All pkgsrc gcc < 10 versions are not ok on 32-bit arm; advance to 10. 55# All pkgsrc gcc < 10 versions are not ok on 32-bit arm; advance to 10.
56.if !empty(POSSIBLE_GFORTRAN_VERSION:M[0-9]) && \ 56.if !empty(POSSIBLE_GFORTRAN_VERSION:M[0-9]) && \
57 !empty(MACHINE_PLATFORM:MNetBSD-*-earm*) 57 !empty(MACHINE_PLATFORM:MNetBSD-*-earm*)
58POSSIBLE_GFORTRAN_VERSION= 10 58POSSIBLE_GFORTRAN_VERSION= 10
59.endif 59.endif
60 60
61# If we are using gcc, and the POSSIBLE version exists in pkgsrc, use it. 61# If we are using gcc, and the POSSIBLE version exists in pkgsrc, use it.
62# Otherwise, pick gcc 7. \todo Revisit this choice. 62# Otherwise, pick gcc 10 as a mainstream default.
63.if !empty(PKGSRC_COMPILER:Mgcc) && \ 63.if !empty(PKGSRC_COMPILER:Mgcc) && \
64 exists(${PKGSRCDIR}/lang/gcc${POSSIBLE_GFORTRAN_VERSION}/buildlink3.mk) 64 exists(${PKGSRCDIR}/lang/gcc${POSSIBLE_GFORTRAN_VERSION}/buildlink3.mk)
65GFORTRAN_VERSION?= ${POSSIBLE_GFORTRAN_VERSION} 65GFORTRAN_VERSION?= ${POSSIBLE_GFORTRAN_VERSION}
66.else 66.else
67GFORTRAN_VERSION?= 7 67GFORTRAN_VERSION?= 10
68.endif 68.endif
69 69
70.if !empty(PKGPATH:Mlang/gcc${GFORTRAN_VERSION}) || !empty(PKGPATH:Mdevel/patch) || \ 70.if !empty(PKGPATH:Mlang/gcc${GFORTRAN_VERSION}) || !empty(PKGPATH:Mdevel/patch) || \
71 !empty(PKGPATH:Mdevel/libtool-base) 71 !empty(PKGPATH:Mdevel/libtool-base)
72IGNORE_GFORTRAN= yes 72IGNORE_GFORTRAN= yes
73MAKEFLAGS+= IGNORE_GFORTRAN=yes 73MAKEFLAGS+= IGNORE_GFORTRAN=yes
74.endif 74.endif
75 75
76.if defined(IGNORE_GFORTRAN) 76.if defined(IGNORE_GFORTRAN)
77_USE_GFORTRAN= NO 77_USE_GFORTRAN= NO
78.endif 78.endif
79 79
80# LANGUAGES.<compiler> is the list of supported languages by the compiler. 80# LANGUAGES.<compiler> is the list of supported languages by the compiler.