diff options
author | jlam <jlam> | 2004-02-05 03:35:20 +0000 |
---|---|---|
committer | jlam <jlam> | 2004-02-05 03:35:20 +0000 |
commit | 7886b984500295c908d21546559157d71c265551 (patch) | |
tree | 84ce346aea1279853619868492e14aa7f57e83c9 /mk/compiler/ccache.mk | |
parent | ace4821d3423e6143b32e6c141eb175c8bc6a806 (diff) | |
download | pkgsrc-7886b984500295c908d21546559157d71c265551.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/ccache.mk')
-rw-r--r-- | mk/compiler/ccache.mk | 73 |
1 files changed, 42 insertions, 31 deletions
diff --git a/mk/compiler/ccache.mk b/mk/compiler/ccache.mk index 8a41c57b9d5..2ed8eefb9be 100644 --- a/mk/compiler/ccache.mk +++ b/mk/compiler/ccache.mk @@ -1,16 +1,16 @@ -# $NetBSD: ccache.mk,v 1.6 2004/02/03 20:38:39 jlam Exp $ +# $NetBSD: ccache.mk,v 1.7 2004/02/05 03:35:20 jlam Exp $ .if !defined(COMPILER_CCACHE_MK) -COMPILER_CCACHE_MK= defined +COMPILER_CCACHE_MK= one -.if !empty(PKGPATH:Mdevel/ccache) +. if !empty(PKGPATH:Mdevel/ccache) IGNORE_CCACHE= yes MAKEFLAGS+= IGNORE_CCACHE=yes -.endif +. endif -.if defined(IGNORE_CCACHE) +. if defined(IGNORE_CCACHE) _USE_CCACHE= NO -.endif +. endif # LANGUAGES.<compiler> is the list of supported languages by the compiler. # _LANGUAGES.<compiler> is ${LANGUAGES.<compiler>} restricted to the ones @@ -18,49 +18,60 @@ _USE_CCACHE= NO # LANGUAGES.ccache= c c++ _LANGUAGES.ccache= # empty -.for _lang_ in ${USE_LANGUAGES} +. for _lang_ in ${USE_LANGUAGES} _LANGUAGES.ccache+= ${LANGUAGES.ccache:M${_lang_}} -.endfor -.if empty(_LANGUAGES.ccache) +. endfor +. if empty(_LANGUAGES.ccache) _USE_CCACHE= NO -.endif +. endif -.if !defined(_USE_CCACHE) +. if !defined(_USE_CCACHE) _USE_CCACHE= YES -.endif - -.if !empty(_USE_CCACHE:M[yY][eE][sS]) -# -# Add the dependency on ccache. -BUILD_DEPENDS+= ccache-[0-9]*:../../devel/ccache -.endif +. endif -EVAL_PREFIX+= _CCACHEBASE=ccache +. if !empty(_USE_CCACHE:M[yY][eE][sS]) +EVAL_PREFIX+= _CCACHEBASE=ccache _CCACHEBASE_DEFAULT= ${LOCALBASE} _CCACHEBASE?= ${LOCALBASE} -.if exists(${_CCACHEBASE}/bin/ccache) +. if exists(${_CCACHEBASE}/bin/ccache) _CCACHE_DIR= ${WRKDIR}/.ccache _CCACHE_LINKS= # empty -. if !empty(_LANGUAGES.ccache) -PATH:= ${_CCACHE_DIR}/bin:${PATH} -. endif -. if !empty(_LANGUAGES.ccache:Mc) +. if !empty(_LANGUAGES.ccache:Mc) CC:= ${_CCACHE_DIR}/bin/${CC:T} _CCACHE_LINKS+= CC -. endif -. if !empty(_LANGUAGES.ccache:Mc++) +. endif +. if !empty(_LANGUAGES.ccache:Mc++) CXX:= ${_CCACHE_DIR}/bin/${CXX:T} _CCACHE_LINKS+= CXX +. endif +. endif . endif +.endif # COMPILER_CCACHE_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_CCACHE_MK:Mtwo) +COMPILER_CCACHE_MK+= two + +. if !empty(_USE_CCACHE:M[yY][eE][sS]) +. if !empty(_LANGUAGES.ccache) +PATH:= ${_CCACHE_DIR}/bin:${PATH} +. endif -. for _target_ in ${_CCACHE_LINKS} +BUILD_DEPENDS+= ccache-[0-9]*:../../devel/ccache + +. if exists(${_CCACHEBASE}/bin/ccache) +. for _target_ in ${_CCACHE_LINKS} override-tools: ${${_target_}} ${${_target_}}: ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG} \ ${LN} -fs ${_CCACHEBASE}/bin/ccache ${.TARGET} -. endfor -.endif - -.endif # COMPILER_CCACHE_MK +. endfor +. endif +. endif +. endif # COMPILER_CCACHE_MK +.endif # BSD_PREFS_MK |