summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2019-09-18 06:35:12 +0000
committerrillig <rillig@pkgsrc.org>2019-09-18 06:35:12 +0000
commit4a895871a41f8192f884fa8adeb3d97b5b8208c2 (patch)
treeee4672f11ef3af04f16946d7ff9dfb6e873c27f9
parent71aa0faa7ac756cf2ed0382f7ed1a155a4e9bebc (diff)
downloadpkgsrc-4a895871a41f8192f884fa8adeb3d97b5b8208c2.tar.gz
mk/compiler/gcc.mk: search for GCCBASE/bin/gcc as well
A default installation of GCC doesn't install bin/cc but only bin/gcc. Adding bin/cc is only done by the pgksrc packages, not by the upstream package. The previous strategy of just checking whether ${GCCBASE}/bin/${CC:[1]} exists did not work in such a situation. Therefore, if CC still has its default value from sys.mk, that is changed to the intended gcc, which then detects the base GCC properly. See https://mail-index.netbsd.org/pkgsrc-users/2019/09/07/msg029329.html. See https://mail-index.netbsd.org/tech-pkg/2019/09/18/msg021976.html.
-rw-r--r--mk/compiler/gcc.mk7
1 files changed, 6 insertions, 1 deletions
diff --git a/mk/compiler/gcc.mk b/mk/compiler/gcc.mk
index 9454375862c..ed0706fc8e2 100644
--- a/mk/compiler/gcc.mk
+++ b/mk/compiler/gcc.mk
@@ -1,4 +1,4 @@
-# $NetBSD: gcc.mk,v 1.205 2019/09/18 06:15:13 rillig Exp $
+# $NetBSD: gcc.mk,v 1.206 2019/09/18 06:35:12 rillig Exp $
#
# This is the compiler definition for the GNU Compiler Collection.
#
@@ -185,6 +185,11 @@ _GCC8_PATTERNS= 8 8.*
# _GCC_AUX_PATTERNS matches 8-digit date YYYYMMDD*
_GCC_AUX_PATTERNS= 20[1-2][0-9][0-1][0-9][0-3][0-9]*
+# Override the default from sys.mk if necessary.
+.if ${CC} == cc && ${GCCBASE:U} && !exists(${GCCBASE}/bin/${CC}) && exists(${GCCBASE}/bin/gcc)
+CC= gcc
+.endif
+
# _CC is the full path to the compiler named by ${CC} if it can be found.
.if !defined(_CC)
_CC:= ${CC:[1]}