ccache/ccache.sh.in
2016-07-26 17:38:26 +03:00

33 lines
1.1 KiB
Bash

# Use ccache by default. Users who don't want that can set the CCACHE_DISABLE
# environment variable in their personal profile.
case ":${PATH:-}:" in
*:@LIBDIR@/ccache:*) ;;
*) PATH="@LIBDIR@/ccache${PATH:+:$PATH}" ;;
esac
# If @CACHEDIR@ is writable, use a shared cache there, except for root.
# Users who don't want that even if they have the write permission can set
# the CCACHE_DIR environment variable to another location and possibly unset
# the CCACHE_UMASK environment variables in their personal profile.
if [ -n "${CCACHE_DIR:-}" ] ; then
if [ ! -w "$CCACHE_DIR" ] ; then
# Reset broken settings maybe inherited when switching users (#651023).
unset CCACHE_DIR
unset CCACHE_UMASK
fi
elif [ "${EUID:-}" != 0 ] ; then
if [ -w @CACHEDIR@ ] && [ -d @CACHEDIR@ ] ; then
# Set up the shared cache.
export CCACHE_DIR=@CACHEDIR@
export CCACHE_UMASK=002
unset CCACHE_HARDLINK
fi
fi
# CCACHE_HASHDIR: https://bugzilla.redhat.com/show_bug.cgi?id=759592
export CCACHE_HASHDIR=
# CCACHE_CPP2: https://bugzilla.redhat.com/show_bug.cgi?id=1350086
export CCACHE_CPP2=