ccache/ccache.sh.in
2016-08-28 10:27:59 +03:00

28 lines
968 B
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