| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: gfortran.mk,v 1.19 2022/04/02 08:01:48 nia Exp $ | | 1 | # $NetBSD: gfortran.mk,v 1.20 2022/04/04 15:38:47 jperkin 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 |
| @@ -37,27 +37,27 @@ COMPILER_GFORTRAN_MK= defined | | | @@ -37,27 +37,27 @@ COMPILER_GFORTRAN_MK= defined |
37 | # possible. Otherwise, default to a mainstream version and hope for the best. | | 37 | # possible. Otherwise, default to a mainstream version and hope for the best. |
38 | # If base compiler is clang, we really should use flang rather than gfortran. | | 38 | # If base compiler is clang, we really should use flang rather than gfortran. |
39 | # \todo Perhaps adjust this so that gcc-4.8.3 maps to 48, or document that 4.8 | | 39 | # \todo Perhaps adjust this so that gcc-4.8.3 maps to 48, or document that 4.8 |
40 | # is so old that we intend what seems like a bug to choose the modern version | | 40 | # is so old that we intend what seems like a bug to choose the modern version |
41 | # in that case. | | 41 | # in that case. |
42 | POSSIBLE_GFORTRAN_VERSION?= ${CC_VERSION:S/gcc-//:C/.[0-9].[0-9]$//} | | 42 | POSSIBLE_GFORTRAN_VERSION?= ${CC_VERSION:S/gcc-//:C/.[0-9].[0-9]$//} |
43 | | | 43 | |
44 | # gcc9 doesn't work on NetBSD/arm, but gcc10 does. | | 44 | # gcc9 doesn't work on NetBSD/arm, but gcc10 does. |
45 | .if !empty(POSSIBLE_GFORTRAN_VERSION:M9) && \ | | 45 | .if !empty(POSSIBLE_GFORTRAN_VERSION:M9) && \ |
46 | !empty(MACHINE_PLATFORM:MNetBSD-*-aarch64*) | | 46 | !empty(MACHINE_PLATFORM:MNetBSD-*-aarch64*) |
47 | POSSIBLE_GFORTRAN_VERSION= 10 | | 47 | POSSIBLE_GFORTRAN_VERSION= 10 |
48 | .endif | | 48 | .endif |
49 | | | 49 | |
50 | .if ${POSSIBLE_GFORTRAN_VERSION} <= 9 && \ | | 50 | .if !empty(POSSIBLE_GFORTRAN_VERSION:M[0-9]) && \ |
51 | !empty(MACHINE_PLATFORM:MNetBSD-*-earm*) | | 51 | !empty(MACHINE_PLATFORM:MNetBSD-*-earm*) |
52 | POSSIBLE_GFORTRAN_VERSION= 10 | | 52 | POSSIBLE_GFORTRAN_VERSION= 10 |
53 | .endif | | 53 | .endif |
54 | | | 54 | |
55 | .if !empty(PKGSRC_COMPILER:Mgcc) && \ | | 55 | .if !empty(PKGSRC_COMPILER:Mgcc) && \ |
56 | exists(${PKGSRCDIR}/lang/gcc${POSSIBLE_GFORTRAN_VERSION}/buildlink3.mk) | | 56 | exists(${PKGSRCDIR}/lang/gcc${POSSIBLE_GFORTRAN_VERSION}/buildlink3.mk) |
57 | GFORTRAN_VERSION?= ${POSSIBLE_GFORTRAN_VERSION} | | 57 | GFORTRAN_VERSION?= ${POSSIBLE_GFORTRAN_VERSION} |
58 | .else | | 58 | .else |
59 | GFORTRAN_VERSION?= 7 | | 59 | GFORTRAN_VERSION?= 7 |
60 | .endif | | 60 | .endif |
61 | | | 61 | |
62 | .if !empty(PKGPATH:Mlang/gcc${GFORTRAN_VERSION}) || !empty(PKGPATH:Mdevel/patch) || \ | | 62 | .if !empty(PKGPATH:Mlang/gcc${GFORTRAN_VERSION}) || !empty(PKGPATH:Mdevel/patch) || \ |
63 | !empty(PKGPATH:Mdevel/libtool-base) | | 63 | !empty(PKGPATH:Mdevel/libtool-base) |