pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk/compiler Test that the lang/gccN exists before defa...
details: https://anonhg.NetBSD.org/pkgsrc/rev/9720423e6c40
branches: trunk
changeset: 412468:9720423e6c40
user: maya <maya%pkgsrc.org@localhost>
date: Sat Mar 07 15:18:19 2020 +0000
description:
Test that the lang/gccN exists before defaulting to N as the gfortran version.
Issue most immediately obvious when trying GCC 9, but probably applies to
some other versions as well.
diffstat:
mk/compiler/gfortran.mk | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diffs (23 lines):
diff -r 79c303a05518 -r 9720423e6c40 mk/compiler/gfortran.mk
--- a/mk/compiler/gfortran.mk Sat Mar 07 15:11:52 2020 +0000
+++ b/mk/compiler/gfortran.mk Sat Mar 07 15:18:19 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: gfortran.mk,v 1.11 2020/02/26 15:58:20 bacon Exp $
+# $NetBSD: gfortran.mk,v 1.12 2020/03/07 15:18:19 maya Exp $
#
# Copyright (c) 2005 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -36,8 +36,11 @@
# 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, we really should use flang rather than gfortran.
-.if ${PKGSRC_COMPILER} == gcc
-GFORTRAN_VERSION?= ${CC_VERSION:C/.[0-9].[0-9]$//:S/gcc-//}
+POSSIBLE_GFORTRAN_VERSION?= ${CC_VERSION:C/.[0-9].[0-9]//:S/gcc-//}
+
+.if (${PKGSRC_COMPILER} == gcc) && \
+ exists(${PKGSRCDIR}/lang/gcc${POSSIBLE_GFORTRAN_VERSION}/buildlink3.mk)
+GFORTRAN_VERSION?= ${POSSIBLE_GFORTRAN_VERSION}
.else
GFORTRAN_VERSION?= 7
.endif
Home |
Main Index |
Thread Index |
Old Index