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/gcc.mk: search for GCCBASE/bin...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e320616f4fec
branches:  trunk
changeset: 401459:e320616f4fec
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Wed Sep 18 06:35:12 2019 +0000

description:
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.

diffstat:

 mk/compiler/gcc.mk |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r f2edf614a514 -r e320616f4fec mk/compiler/gcc.mk
--- a/mk/compiler/gcc.mk        Wed Sep 18 06:15:13 2019 +0000
+++ b/mk/compiler/gcc.mk        Wed Sep 18 06:35:12 2019 +0000
@@ -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 @@
 # _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]}



Home | Main Index | Thread Index | Old Index