summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authortv <tv@pkgsrc.org>2005-01-21 21:59:14 +0000
committertv <tv@pkgsrc.org>2005-01-21 21:59:14 +0000
commit1e0e1ad1d5b7561d7bb20d853744209b7b49af33 (patch)
tree710a56582867a8aee177ddd2abbb0a28085c8320 /mk
parentf58dee3976ac0838c7b06ae8e3e52fb558d95fdf (diff)
downloadpkgsrc-1e0e1ad1d5b7561d7bb20d853744209b7b49af33.tar.gz
Re-add direct symlink logic, optional under GCC_USE_SYMLINKS=yes. Saves
one fork/exec step on platforms where gcc is compiled with hardcoded gcc-lib pathnames. This applies to most platforms, but the default currently remains not to use symlinks so as to avoid unexpected gotchas for users.
Diffstat (limited to 'mk')
-rw-r--r--mk/compiler/gcc.mk10
1 files changed, 8 insertions, 2 deletions
diff --git a/mk/compiler/gcc.mk b/mk/compiler/gcc.mk
index 8939db1e9f5..60b47b13a0e 100644
--- a/mk/compiler/gcc.mk
+++ b/mk/compiler/gcc.mk
@@ -1,4 +1,4 @@
-# $NetBSD: gcc.mk,v 1.78 2005/01/12 15:32:01 jlam Exp $
+# $NetBSD: gcc.mk,v 1.79 2005/01/21 21:59:14 tv Exp $
.if !defined(COMPILER_GCC_MK)
COMPILER_GCC_MK= defined
@@ -417,20 +417,26 @@ BUILD_DEPENDS+= ${_GCC_DEPENDENCY}
.endif
# Create compiler driver scripts in ${WRKDIR}.
+GCC_USE_SYMLINKS?= no
.for _var_ in ${_GCC_VARS}
. if !target(${_GCC_${_var_}})
override-tools: ${_GCC_${_var_}}
${_GCC_${_var_}}:
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
+. if !empty(GCC_USE_SYMLINKS:Myes)
+ ${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${.TARGET}
+ ${_PKG_SILENT}${_PKG_DEBUG}${LN} -s ${_GCCBINDIR}/${.TARGET:T} ${.TARGET}
+. else
${_PKG_SILENT}${_PKG_DEBUG} \
(${ECHO} '#!${TOOLS_SHELL}'; \
${ECHO} 'exec ${_GCCBINDIR}/${.TARGET:T} "$$@"'; \
) > ${.TARGET}
${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET}
+. endif
. for _alias_ in ${_ALIASES.${_var_}:S/^/${.TARGET:H}\//}
${_PKG_SILENT}${_PKG_DEBUG} \
if [ ! -x "${_alias_}" ]; then \
- ${LN} -f ${.TARGET} ${_alias_}; \
+ ${LN} -f -s ${.TARGET:T} ${_alias_}; \
fi
. endfor
. endif