summaryrefslogtreecommitdiff
path: root/mk/compiler/distcc.mk
diff options
context:
space:
mode:
authorjlam <jlam>2004-02-02 10:03:46 +0000
committerjlam <jlam>2004-02-02 10:03:46 +0000
commitee3947dbae78ee8d2865482494af03e3a17da547 (patch)
treee2e3af98911ed47bc54396ea26ce2200bee342f5 /mk/compiler/distcc.mk
parent3c41e011295805534251dbeb5e399786fd82f151 (diff)
downloadpkgsrc-ee3947dbae78ee8d2865482494af03e3a17da547.tar.gz
Support a new variable in package Makefiles:
USE_LANGUAGES Lists the languages used in the source code of the package, and is used to determine the correct compilers to install. Valid values are: c, c++, fortran, java, objc. The default is "c". Packages that don't need any compilers and set this variable to an empty value, e.g. "USE_LANGUAGES=". This can probably be combined in some smart way with setting USE_GCC_SHLIBS and USE_FORTRAN automatically.
Diffstat (limited to 'mk/compiler/distcc.mk')
-rw-r--r--mk/compiler/distcc.mk27
1 files changed, 23 insertions, 4 deletions
diff --git a/mk/compiler/distcc.mk b/mk/compiler/distcc.mk
index f32af1ba352..dc44821b707 100644
--- a/mk/compiler/distcc.mk
+++ b/mk/compiler/distcc.mk
@@ -1,4 +1,4 @@
-# $NetBSD: distcc.mk,v 1.2 2004/02/01 01:33:06 jlam Exp $
+# $NetBSD: distcc.mk,v 1.3 2004/02/02 10:03:46 jlam Exp $
.if !defined(COMPILER_DISTCC_MK)
COMPILER_DISTCC_MK= defined
@@ -12,6 +12,19 @@ MAKEFLAGS+= IGNORE_DISTCC=yes
_USE_DISTCC= NO
.endif
+# LANGUAGES.<compiler> is the list of supported languages by the compiler.
+# _LANGUAGES.<compiler> is ${LANGUAGES.<compiler>} restricted to the ones
+# requested by the package in USE_LANGUAGES.
+#
+LANGUAGES.distcc= c c++
+_LANGUAGES.distcc= # empty
+.for _lang_ in ${USE_LANGUAGES}
+_LANGUAGES.distcc= ${LANGUAGES.distcc:M${_lang_}}
+.endfor
+.if empty(_LANGUAGES.distcc)
+_USE_CCACHE= NO
+.endif
+
.if !defined(_USE_DISTCC)
_USE_DISTCC= YES
.endif
@@ -30,10 +43,16 @@ _DISTCCBASE?= ${LOCALBASE}
_DISTCC_DIR= ${WRKDIR}/.distcc
PATH:= ${_DISTCC_DIR}/bin:${PATH}
-CC:= ${_DISTCC_DIR}/bin/${CC:T}
-CXX:= ${_DISTCC_DIR}/bin/${CXX:T}
+.if !empty(_LANGUAGES:distcc:Mc)
+CC:= ${_DISTCC_DIR}/bin/${CC:T}
+_DISTCC_LINKS+= CC
+.endif
+.if !empty(_LANGUAGES:distcc:Mc++)
+CXX:= ${_DISTCC_DIR}/bin/${CXX:T}
+_DISTCC_LINKS+= CXX
+.endif
-. for _target_ in CC CXX
+. for _target_ in ${_DISTCC_LINKS}
override-tools: ${${_target_}}
${${_target_}}:
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}