summaryrefslogtreecommitdiff
path: root/mk/compiler/distcc.mk
diff options
context:
space:
mode:
authorjlam <jlam>2004-11-30 14:50:37 +0000
committerjlam <jlam>2004-11-30 14:50:37 +0000
commite0816cd38aa2ae18161632428746d5be7aaa3a3f (patch)
treefe0208b86b0f4fd875482f1d22c775959c8becd5 /mk/compiler/distcc.mk
parent7c1706f998521d0013716738556e9998544afcfa (diff)
downloadpkgsrc-e0816cd38aa2ae18161632428746d5be7aaa3a3f.tar.gz
Modify the way that the toolchain variables, e.g. CC, CPP, CXX, LD, etc.,
are handled. The idea now is to simply remove the paths in the values of these variables, leaving behind only the basename plus any arguments, e.g.: CC= /usr/local/bin/gcc becomes CC= gcc CPP= /usr/local/bin/gcc -E becomes CPP= gcc -E The wrapper scripts are generated for every unique executable mentioned by the toolchain variables, so for the example above, only a "gcc" wrapper script is generated for ${CC} and ${CPP}. PKG_{CC,CPP,CXX,etc.} are the paths to the executables wrapped by the wrapper scripts. Note that it's now possible to set "CC" to something more than just the path to the compiler, e.g. CC= cc -ffast-math -funroll-loops -fomit-frame-pointer and the full value of ${CC} will be passed through via CONFIGURE_ENV and MAKE_ENV.
Diffstat (limited to 'mk/compiler/distcc.mk')
-rw-r--r--mk/compiler/distcc.mk28
1 files changed, 18 insertions, 10 deletions
diff --git a/mk/compiler/distcc.mk b/mk/compiler/distcc.mk
index 00e7c34e71a..538bbf7b8e9 100644
--- a/mk/compiler/distcc.mk
+++ b/mk/compiler/distcc.mk
@@ -1,4 +1,4 @@
-# $NetBSD: distcc.mk,v 1.21 2004/11/17 17:18:33 tv Exp $
+# $NetBSD: distcc.mk,v 1.22 2004/11/30 14:50:37 jlam Exp $
.if !defined(COMPILER_DISTCC_MK)
COMPILER_DISTCC_MK= defined
@@ -37,18 +37,20 @@ _DISTCCBASE_DEFAULT= ${LOCALBASE}
_DISTCCBASE?= ${LOCALBASE}
_DISTCC_DIR= ${WRKDIR}/.distcc
-_DISTCC_LINKS= # empty
+_DISTCC_VARS= # empty
. if !empty(_LANGUAGES.distcc:Mc)
+PKG_CC?= ${CC}
+_DISTCC_VARS+= CC
_DISTCC_CC:= ${_DISTCC_DIR}/bin/${PKG_CC:T}
-_DISTCC_LINKS+= _DISTCC_CC
+_ALIASES.CC?= cc
PKG_CC:= ${_DISTCC_CC}
-CC= ${PKG_CC:T}
. endif
. if !empty(_LANGUAGES.distcc:Mc++)
+PKG_CXX?= ${CXX}
+_DISTCC_VARS+= CXX
_DISTCC_CXX:= ${_DISTCC_DIR}/bin/${PKG_CXX:T}
-_DISTCC_LINKS+= _DISTCC_CXX
+_ALIASES.CXX?= c++
PKG_CXX:= ${_DISTCC_CXX}
-CXX= ${PKG_CXX:T}
. endif
# Prepend the path to the compiler to the PATH.
@@ -70,13 +72,19 @@ BUILD_ENV+= DISTCC_VERBOSE=${DISTCC_VERBOSE:Q}
.endif
# Create symlinks for the compiler into ${WRKDIR}.
-. for _target_ in ${_DISTCC_LINKS}
-. if !target(${${_target_}})
-override-tools: ${${_target_}}
-${${_target_}}:
+. for _var_ in ${_DISTCC_VARS}
+. if !target(${_DISTCC_${_var_}})
+override-tools: ${_DISTCC_${_var_}}
+${_DISTCC_${_var_}}:
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
${_PKG_SILENT}${_PKG_DEBUG} \
${LN} -fs ${_DISTCCBASE}/bin/distcc ${.TARGET}
+. for _alias_ in ${_ALIASES.${_var_}:S/^/${.TARGET:H}\//}
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ if [ ! -x "${_alias_}" ]; then \
+ ${LN} -fs ${_DISTCCBASE}/bin/distcc ${_alias_}; \
+ fi
+. endfor
. endif
. endfor
.endif # _USE_DISTCC == "yes"