Rename GCC_USE_SYMLINKS to COMPILER_USE_SYMLINKS, implement it for the

other compiler drivers and enable it by default. Saves at least a
percent of build time even for trivial packages like lang/lua.
This commit is contained in:
joerg 2009-05-30 18:16:26 +00:00
parent 62df2b30e0
commit 9377afae3f
8 changed files with 48 additions and 13 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: compiler.mk,v 1.68 2008/10/20 20:44:49 wiz Exp $
# $NetBSD: compiler.mk,v 1.69 2009/05/30 18:16:26 joerg Exp $
#
# This Makefile fragment implements handling for supported C/C++/Fortran
# compilers.
@ -36,6 +36,12 @@
# Force using the appropriate version of GCC from pkgsrc based on
# GCC_REQD instead of the native compiler.
#
# This should be disabled only for debugging.
#
# COMPILER_USE_SYMLINKS
# If set to yes, use symlinks for the compiler drivers, otherwise
# shell scripts are created. The default is yes.
#
# The following variables may be set by a package:
#
# GCC_REQD
@ -72,7 +78,7 @@
BSD_COMPILER_MK= defined
_VARGROUPS+= compiler
_USER_VARS.compiler= PKGSRC_COMPILER USE_PKGSRC_GCC ABI
_USER_VARS.compiler= PKGSRC_COMPILER USE_PKGSRC_GCC ABI COMPILER_USE_SYMLINKS
_PKG_VARS.compiler= USE_LANGUAGES GCC_REQD NOT_FOR_COMPILER ONLY_FOR_COMPILER
_SYS_VARS.compiler= CC_VERSION
@ -86,6 +92,8 @@ USE_LANGUAGES?= c
USE_LANGUAGES+= c
.endif
COMPILER_USE_SYMLINKS?= yes
# For environments where there is an external gcc too, but pkgsrc
# should use the pkgsrc one for consistency.
#

View file

@ -1,4 +1,4 @@
# $NetBSD: ccc.mk,v 1.17 2008/02/07 20:59:05 rillig Exp $
# $NetBSD: ccc.mk,v 1.18 2009/05/30 18:16:26 joerg Exp $
#
# This is the compiler definition for the Compaq C Compilers.
#
@ -70,11 +70,16 @@ PREPEND_PATH+= ${_CCC_DIR}/bin
override-tools: ${_CCC_${_var_}}
${_CCC_${_var_}}:
${RUN}${MKDIR} ${.TARGET:H}
. if !empty(COMPILER_USE_SYMLINKS:M[Yy][Ee][Ss])
${RUN}${RM} -f ${.TARGET}
${RUN}${LN} -s /usr/bin/${.TARGET:T} ${.TARGET}
. else
${RUN} \
(${ECHO} '#!${TOOLS_SHELL}'; \
${ECHO} 'exec /usr/bin/${.TARGET:T} "$$@"'; \
) > ${.TARGET}
${RUN}${CHMOD} +x ${.TARGET}
. endif
. for _alias_ in ${_ALIASES.${_var_}:S/^/${.TARGET:H}\//}
${RUN} \
if [ ! -x "${_alias_}" ]; then \

View file

@ -1,4 +1,4 @@
# $NetBSD: gcc.mk,v 1.96 2009/03/17 21:28:10 rillig Exp $
# $NetBSD: gcc.mk,v 1.97 2009/05/30 18:16:26 joerg Exp $
#
# This is the compiler definition for the GNU Compiler Collection.
#
@ -39,7 +39,6 @@ _SYS_VARS.gcc= CC_VERSION CC_VERSION_STRING LANGUAGES.gcc
_DEF_VARS.gcc= \
CCPATH CPPPATH CXXPATH \
F77PATH FCPATH \
GCC_USE_SYMLINKS \
IMAKEOPTS \
LDFLAGS \
PKG_CC PKG_CPP PKG_CXX PKG_FC \
@ -481,14 +480,12 @@ PREPEND_PATH+= ${_GCC_DIR}/bin
. endfor
.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_}}:
${RUN}${MKDIR} ${.TARGET:H}
. if !empty(GCC_USE_SYMLINKS:Myes)
. if !empty(COMPILER_USE_SYMLINKS:M[Yy][Ee][Ss])
${RUN}${RM} -f ${.TARGET}
${RUN}${LN} -s ${_GCCBINDIR}/${.TARGET:T} ${.TARGET}
. else

View file

@ -1,4 +1,4 @@
# $NetBSD: hp.mk,v 1.5 2008/02/07 20:59:05 rillig Exp $
# $NetBSD: hp.mk,v 1.6 2009/05/30 18:16:26 joerg Exp $
#
# This is the compiler definition for the HP-UX C/aC++ compilers.
#
@ -72,11 +72,16 @@ PREPEND_PATH+= ${_HP_DIR}/bin
override-tools: ${_HP_${_var_}}
${_HP_${_var_}}:
${RUN}${MKDIR} ${.TARGET:H}
. if !empty(COMPILER_USE_SYMLINKS:M[Yy][Ee][Ss])
${RUN}${RM} -f ${.TARGET}
${RUN}${LN} -s ${${_var_}PATH} ${.TARGET}
. else
${RUN} \
(${ECHO} '#!${TOOLS_SHELL}'; \
${ECHO} 'exec ${${_var_}PATH} "$$@"'; \
) > ${.TARGET}
${RUN}${CHMOD} +x ${.TARGET}
. endif
. for _alias_ in ${_ALIASES.${_var_}:S/^/${.TARGET:H}\//}
${RUN} \
if [ ! -x "${_alias_}" ]; then \

View file

@ -1,4 +1,4 @@
# $NetBSD: icc.mk,v 1.5 2008/02/07 20:59:05 rillig Exp $
# $NetBSD: icc.mk,v 1.6 2009/05/30 18:16:26 joerg Exp $
#
# This is the compiler definition for the Intel compilers.
#
@ -81,11 +81,16 @@ CONFIGURE_ENV+= ac_cv___attribute__=yes
override-tools: ${_ICC_${_var_}}
${_ICC_${_var_}}:
${RUN}${MKDIR} ${.TARGET:H}
. if !empty(COMPILER_USE_SYMLINKS:M[Yy][Ee][Ss])
${RUN}${RM} -f ${.TARGET}
${RUN}${LN} -s ${ICCBASE}/bin/${.TARGET:T} ${.TARGET}
. else
${RUN} \
(${ECHO} '#!${TOOLS_SHELL}'; \
${ECHO} 'exec ${ICCBASE}/bin/${.TARGET:T} "$$@"'; \
) > ${.TARGET}
${RUN}${CHMOD} +x ${.TARGET}
. endif
. for _alias_ in ${_ALIASES.${_var_}:S/^/${.TARGET:H}\//}
${RUN} \
if [ ! -x "${_alias_}" ]; then \

View file

@ -1,4 +1,4 @@
# $NetBSD: ido.mk,v 1.6 2008/02/07 20:59:05 rillig Exp $
# $NetBSD: ido.mk,v 1.7 2009/05/30 18:16:26 joerg Exp $
#
# This is the compiler definition for the SGI IRIS Development Option
# cc (IRIX 5).
@ -67,11 +67,16 @@ PREPEND_PATH+= ${_IDO_DIR}/bin
override-tools: ${_IDO_${_var_}}
${_IDO_${_var_}}:
${RUN}${MKDIR} ${.TARGET:H}
. if !empty(COMPILER_USE_SYMLINKS:M[Yy][Ee][Ss])
${RUN}${RM} -f ${.TARGET}
${RUN}${LN} -s ${${_var_}PATH} ${.TARGET}
. else
${RUN} \
(${ECHO} '#!${TOOLS_SHELL}'; \
${ECHO} 'exec ${${_var_}PATH} "$$@"'; \
) > ${.TARGET}
${RUN}${CHMOD} +x ${.TARGET}
. endif
. for _alias_ in ${_ALIASES.${_var_}:S/^/${.TARGET:H}\//}
${RUN} \
if [ ! -x "${_alias_}" ]; then \

View file

@ -1,4 +1,4 @@
# $NetBSD: mipspro.mk,v 1.39 2008/02/07 20:59:05 rillig Exp $
# $NetBSD: mipspro.mk,v 1.40 2009/05/30 18:16:26 joerg Exp $
#
# This is the compiler definition for the MIPSpro C compiler.
#
@ -91,11 +91,16 @@ PREPEND_PATH+= ${_MIPSPRO_DIR}/bin
override-tools: ${_MIPSPRO_${_var_}}
${_MIPSPRO_${_var_}}:
${RUN}${MKDIR} ${.TARGET:H}
. if !empty(COMPILER_USE_SYMLINKS:M[Yy][Ee][Ss])
${RUN}${RM} -f ${.TARGET}
${RUN}${LN} -s ${MIPSPROBASE}/bin/${.TARGET:T} ${.TARGET}
. else
${RUN} \
(${ECHO} '#!${TOOLS_SHELL}'; \
${ECHO} 'exec ${MIPSPROBASE}/bin/${.TARGET:T} "$$@"'; \
) > ${.TARGET}
${RUN}${CHMOD} +x ${.TARGET}
. endif
. for _alias_ in ${_ALIASES.${_var_}:S/^/${.TARGET:H}\//}
${RUN} \
if [ ! -x "${_alias_}" ]; then \

View file

@ -1,4 +1,4 @@
# $NetBSD: xlc.mk,v 1.22 2009/01/09 11:46:34 joerg Exp $
# $NetBSD: xlc.mk,v 1.23 2009/05/30 18:16:26 joerg Exp $
#
# Copyright (c) 2005 The NetBSD Foundation, Inc.
# All rights reserved.
@ -145,11 +145,16 @@ ${_XLC_CPP}:
override-tools: ${_XLC_${_var_}}
${_XLC_${_var_}}:
${RUN}${MKDIR} ${.TARGET:H}
. if !empty(COMPILER_USE_SYMLINKS:M[Yy][Ee][Ss])
${RUN}${RM} -f ${.TARGET}
${RUN}${LN} -s ${XLCBASE}/bin/${.TARGET:T} ${.TARGET}
. else
${RUN} \
(${ECHO} '#!${TOOLS_SHELL}'; \
${ECHO} 'exec ${XLCBASE}/bin/${.TARGET:T} "$$@"'; \
) > ${.TARGET}
${RUN}${CHMOD} +x ${.TARGET}
. endif
. for _alias_ in ${_ALIASES.${_var_}:S/^/${.TARGET:H}\//}
${RUN} \
if [ ! -x "${_alias_}" ]; then \