pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/compiler mk/compiler/gfortran: Default to same majo...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e477c5a044d5
branches:  trunk
changeset: 423783:e477c5a044d5
user:      bacon <bacon%pkgsrc.org@localhost>
date:      Wed Feb 26 15:58:20 2020 +0000

description:
mk/compiler/gfortran: Default to same major version as base GCC

GFORTRAN_VERSION should match CC_VERSION as closely as possible for
ABI compatibility.  This update tries to match GFORTRAN_VERSION
to CC_VERSION if the base compiler is GCC.  If base compiler is not
GCC, default to a mainstream version likely to work with base clang/llvm.

diffstat:

 mk/compiler/gfortran.mk |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (25 lines):

diff -r 0fe332240a7a -r e477c5a044d5 mk/compiler/gfortran.mk
--- a/mk/compiler/gfortran.mk   Wed Feb 26 15:47:34 2020 +0000
+++ b/mk/compiler/gfortran.mk   Wed Feb 26 15:58:20 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: gfortran.mk,v 1.10 2018/08/22 20:48:37 maya Exp $
+# $NetBSD: gfortran.mk,v 1.11 2020/02/26 15:58:20 bacon Exp $
 #
 # Copyright (c) 2005 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -33,7 +33,14 @@
 
 .include "../../mk/bsd.prefs.mk"
 
-GFORTRAN_VERSION?=     48
+# 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-//}
+.else
+GFORTRAN_VERSION?=     7
+.endif
 
 .if !empty(PKGPATH:Mlang/gcc${GFORTRAN_VERSION}) || !empty(PKGPATH:Mdevel/patch) || \
     !empty(PKGPATH:Mdevel/libtool-base)



Home | Main Index | Thread Index | Old Index