summaryrefslogtreecommitdiff
path: root/mk/compiler/mipspro.mk
diff options
context:
space:
mode:
authorjlam <jlam>2004-02-05 03:35:20 +0000
committerjlam <jlam>2004-02-05 03:35:20 +0000
commit7886b984500295c908d21546559157d71c265551 (patch)
tree84ce346aea1279853619868492e14aa7f57e83c9 /mk/compiler/mipspro.mk
parentace4821d3423e6143b32e6c141eb175c8bc6a806 (diff)
downloadpkgsrc-7886b984500295c908d21546559157d71c265551.tar.gz
Allow bsd.compiler.mk to be included by both bsd.prefs.mk and bsd.pkg.mk.
Any additions to DEPENDS/BUILD_DEPENDS or inclusions of buildlink[23].mk files are deferred till bsd.compiler.mk is included by bsd.pkg.mk. We allow bsd.compiler.mk to be included by bsd.prefs.mk solely for the purpose of setting CC_VERSION properly for use by package Makefiles. There is the surprising behaviour that CC_VERSION won't necessarily have the correct value at all times until after "make extract" has been completed (dependencies are installed before "make extract"), so package Makefile writers should keep that in mind. Just to note that this is _existing_ behaviour that's preserved by these changes.
Diffstat (limited to 'mk/compiler/mipspro.mk')
-rw-r--r--mk/compiler/mipspro.mk40
1 files changed, 25 insertions, 15 deletions
diff --git a/mk/compiler/mipspro.mk b/mk/compiler/mipspro.mk
index e7ecd4986dc..ea7dbf90cb9 100644
--- a/mk/compiler/mipspro.mk
+++ b/mk/compiler/mipspro.mk
@@ -1,7 +1,7 @@
-# $NetBSD: mipspro.mk,v 1.8 2004/02/05 01:57:38 jlam Exp $
+# $NetBSD: mipspro.mk,v 1.9 2004/02/05 03:35:20 jlam Exp $
.if !defined(COMPILER_MIPSPRO_MK)
-COMPILER_MIPSPRO_MK= defined
+COMPILER_MIPSPRO_MK= one
MIPSPROBASE?= /usr
@@ -11,25 +11,35 @@ MIPSPROBASE?= /usr
#
LANGUAGES.mipspro= c c++
_LANGUAGES.mipspro= # empty
-.for _lang_ in ${USE_LANGUAGES}
+. for _lang_ in ${USE_LANGUAGES}
_LANGUAGES.mipspro+= ${LANGUAGES.mipspro:M${_lang_}}
-.endfor
+. endfor
-.if !empty(_LANGUAGES.mipspro)
-PATH:= ${MIPSPROBASE}/bin:${PATH}
-.endif
-.if !empty(_LANGUAGES.mipspro:Mc)
+. if !empty(_LANGUAGES.mipspro:Mc)
CC= ${MIPSPROBASE}/bin/cc
CPP= ${MIPSPROBASE}/bin/cc -E
-.endif
-.if !empty(_LANGUAGES.mipspro:Mc++)
+. endif
+. if !empty(_LANGUAGES.mipspro:Mc++)
CXX= ${MIPSPROBASE}/bin/CC
-.endif
+. endif
-if exists(${CC})
+. if exists(${CC})
CC_VERSION!= ${CC} -V 2>&1 | ${GREP} '^cc'
-.else
+. else
CC_VERSION= mipspro
-.endif
-
+. endif
.endif # COMPILER_MIPSPRO_MK
+
+# The following section is included only if we're not being included by
+# bsd.prefs.mk.
+#
+.if empty(BSD_PREFS_MK:M+*)
+. if empty(COMPILER_MIPSPRO_MK:Mtwo)
+COMPILER_MIPSPRO_MK+= two
+
+# Prepend the path to the compiler to the PATH.
+. if !empty(_LANGUAGES.mipspro)
+PATH:= ${MIPSPROBASE}/bin:${PATH}
+. endif
+. endif # COMPILER_MIPSPRO_MK
+.endif # BSD_PREFS_MK