pkgsrc-Changes archive

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

CVS commit: pkgsrc/mk/compiler



Module Name:    pkgsrc
Committed By:   rillig
Date:           Wed Sep 18 06:35:12 UTC 2019

Modified Files:
        pkgsrc/mk/compiler: gcc.mk

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.205 -r1.206 pkgsrc/mk/compiler/gcc.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/compiler/gcc.mk
diff -u pkgsrc/mk/compiler/gcc.mk:1.205 pkgsrc/mk/compiler/gcc.mk:1.206
--- pkgsrc/mk/compiler/gcc.mk:1.205     Wed Sep 18 06:15:13 2019
+++ pkgsrc/mk/compiler/gcc.mk   Wed Sep 18 06:35:12 2019
@@ -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]}



Home | Main Index | Thread Index | Old Index