4 |
- |
1 |
# Use ccache by default. Users who don't want that can set the CCACHE_DISABLE
|
|
|
2 |
# environment variable in their personal profile.
|
|
|
3 |
|
|
|
4 |
case ":${PATH:-}:" in
|
|
|
5 |
*:/usr/lib64/ccache:*) ;;
|
|
|
6 |
*) PATH="/usr/lib64/ccache${PATH:+:$PATH}" ;;
|
|
|
7 |
esac
|
|
|
8 |
|
|
|
9 |
# If /var/cache/ccache is writable, use a shared cache there, except for root.
|
|
|
10 |
# Users who don't want that even if they have the write permission can set
|
|
|
11 |
# the CCACHE_DIR environment variable to another location and possibly unset
|
|
|
12 |
# the CCACHE_UMASK environment variables in their personal profile.
|
|
|
13 |
|
|
|
14 |
if [ -n "${CCACHE_DIR:-}" ] ; then
|
|
|
15 |
if [ ! -w "$CCACHE_DIR" ] ; then
|
|
|
16 |
# Reset broken settings maybe inherited when switching users (#651023).
|
|
|
17 |
unset CCACHE_DIR
|
|
|
18 |
unset CCACHE_UMASK
|
|
|
19 |
fi
|
|
|
20 |
elif [ "${EUID:-}" != 0 ] ; then
|
|
|
21 |
if [ -w /var/cache/ccache ] && [ -d /var/cache/ccache ] ; then
|
|
|
22 |
# Set up the shared cache.
|
|
|
23 |
export CCACHE_DIR=/var/cache/ccache
|
|
|
24 |
export CCACHE_UMASK=002
|
|
|
25 |
unset CCACHE_HARDLINK
|
|
|
26 |
fi
|
|
|
27 |
fi
|
|
|
28 |
|
|
|
29 |
export CCACHE_HASHDIR=
|