[CFT] Buildworld ccache support
Freddie Cash
fjwcash at gmail.com
Tue Oct 20 15:50:37 UTC 2015
On Tue, Oct 20, 2015 at 6:32 AM, Juan Ramón Molina Menor <listjm at club.fr>
wrote:
> Hi!
>
> I’m certainly doing it wrong, because CCACHE does not kick in after
> applying the patch and modifying make.conf. CCACHE stats ('ccache -z'
> followed by 'ccache -s') remain at zero during buildworld while they used
> to reflect the cache miss/hits before.
>
> # cat /etc/make.conf
> WITH_CCACHE_BUILD=
>
You need to actually set this to a value, in order for the variable to be
defined.
WITH_CCACHE_BUILD=yes
WITH_CCACHE_BUILD=something
WITH_CCACHE_BUILD=whatever
It doesn't matter what it's set to, but it has to be set to something.
>
> # svn diff /usr/src/share/mk/local.init.mk
> Index: /usr/src/share/mk/local.init.mk
> ===================================================================
> --- /usr/src/share/mk/local.init.mk (revision 289627)
> +++ /usr/src/share/mk/local.init.mk (working copy)
> @@ -38,3 +38,37 @@
> HOST_CFLAGS+= -DHOSTPROG
> CFLAGS+= ${HOST_CFLAGS}
> .endif
> +
> +# Handle ccache after CC is determined. If CC is at some specific path
> then
> +# we must prepend the ccache wrapper. Otherwise we can just prepend PATH
> with
> +# the wrapper location, which is a more safe solution since it avoids
> spaces
> +# and compiler type guessing based on filename.
> +LOCALBASE?= /usr/local
> +CCACHE_WRAPPER_PATH?= ${LOCALBASE}/libexec/ccache
> +CCACHE_PATH?= ${LOCALBASE}/bin/ccache
> +.if defined(WITH_CCACHE_BUILD) && !defined(NOCCACHE) && \
>
This line here checks if the variable is defined (meaning, that it is set
to something), and if it is, then the code after it enabled CCACHE.
--
Freddie Cash
fjwcash at gmail.com
More information about the freebsd-current
mailing list