summaryrefslogtreecommitdiff
path: root/mk/compiler/sunpro.mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-02-05 03:35:20 +0000
committerjlam <jlam@pkgsrc.org>2004-02-05 03:35:20 +0000
commitc2d20bedad498d2bf5cda3907503947cbece550a (patch)
tree84ce346aea1279853619868492e14aa7f57e83c9 /mk/compiler/sunpro.mk
parent1a04714dd4f768ce5c6e515b6175cf404065241a (diff)
downloadpkgsrc-c2d20bedad498d2bf5cda3907503947cbece550a.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/sunpro.mk')
-rw-r--r--mk/compiler/sunpro.mk40
1 files changed, 25 insertions, 15 deletions
diff --git a/mk/compiler/sunpro.mk b/mk/compiler/sunpro.mk
index 7618004907f..aa8a5bcadef 100644
--- a/mk/compiler/sunpro.mk
+++ b/mk/compiler/sunpro.mk
@@ -1,7 +1,7 @@
-# $NetBSD: sunpro.mk,v 1.6 2004/02/05 01:57:38 jlam Exp $
+# $NetBSD: sunpro.mk,v 1.7 2004/02/05 03:35:20 jlam Exp $
.if !defined(COMPILER_SUNPRO_MK)
-COMPILER_SUNPRO_MK= defined
+COMPILER_SUNPRO_MK= one
SUNWSPROBASE?= /opt/SUNWspro
@@ -11,27 +11,37 @@ SUNWSPROBASE?= /opt/SUNWspro
#
LANGUAGES.sunpro= c c++
_LANGUAGES.sunpro= # empty
-.for _lang_ in ${USE_LANGUAGES}
+. for _lang_ in ${USE_LANGUAGES}
_LANGUAGES.sunpro+= ${LANGUAGES.sunpro:M${_lang_}}
-.endfor
+. endfor
-.if !empty(_LANGUAGES.sunpro)
-PATH:= ${SUNWSPROBASE}/bin:${PATH}
-.endif
-.if !empty(_LANGUAGES.sunpro:Mc)
+. if !empty(_LANGUAGES.sunpro:Mc)
CC= ${SUNWSPROBASE}/bin/cc
CPP= ${SUNWSPROBASE}/bin/cc -E
-.endif
-.if !empty(_LANGUAGES.sunpro:Mc++)
+. endif
+. if !empty(_LANGUAGES.sunpro:Mc++)
CXX= ${SUNWSPROBASE}/bin/CC
-.endif
+. endif
_COMPILER_LD_FLAG= # empty
-.if exists(${CC})
+. if exists(${CC})
CC_VERSION!= ${CC} -V 2>&1 | ${GREP} '^cc'
-.else
+. else
CC_VERSION= sunpro
-.endif
-
+. endif
.endif # COMPILER_SUNPRO_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_SUNPRO_MK:Mtwo)
+COMPILER_SUNPRO_MK+= two
+
+# Prepend the path to the compiler to the PATH.
+. if !empty(_LANGUAGES.sunpro)
+PATH:= ${SUNWSPROBASE}/bin:${PATH}
+. endif
+. endif # COMPILER_SUNPRO_MK
+.endif # BSD_PREFS_MK