You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.1 KiB

# (C) Martin V\"ath <martin at>
# SPDX-License-Identifier: GPL-2.0-only
# Portage explicitly unsets all CCACHE_* variables in each phase.
# Therefore, we save them to BASHRCD_CCACHE_* in the setup phase;
# in all later phases, we restore CCACHE_* from these variables
CcacheSetup() {
local i
: ${CCACHE_BASEDIR=${PORTAGE_TMPDIR:-/var/tmp}/portage}
: ${CCACHE_SLOPPINESS='file_macro,time_macros,include_file_mtime,include_file_ctime,file_stat_matches,pch_defines'}
if BashrcdTrue $USE_NONGNU && BashrcdTrue $CCACHE_CPP2_OPTIONAL
then : ${CCACHE_CPP2=true}
# Default to NOHASHDIR unless contrary is specified
for i in ${!CCACHE_*}
do if eval "BashrcdTrue \$$i"
then eval BASHRCD_$i=\$$i
export $i
else unset $i
CcacheRestore() {
local i j
unset ${!CCACHE_*}
for i in ${!BASHRCD_CCACHE_*}
do j=${i##BASHRCD_}
eval $j=\$$i
export $j
CcacheRestore() {
# Register CcacheRestore before CcacheSetup to save time in setup phase
BashrcdPhase all CcacheRestore
BashrcdPhase setup CcacheSetup