2007-07-29 22:38:31 +00:00
|
|
|
# Use ccache by default. Users who don't want that can set the CCACHE_DISABLE
|
|
|
|
# environment variable in their personal profile.
|
|
|
|
|
2010-09-18 10:28:39 +00:00
|
|
|
case ":${PATH:-}:" in
|
2010-06-04 19:57:27 +00:00
|
|
|
*:@LIBDIR@/ccache:*) ;;
|
2010-09-18 10:28:39 +00:00
|
|
|
*) PATH="@LIBDIR@/ccache${PATH:+:$PATH}" ;;
|
2010-06-04 19:57:27 +00:00
|
|
|
esac
|
2007-07-29 22:38:31 +00:00
|
|
|
|
2011-04-02 09:55:00 +00:00
|
|
|
# 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.
|
2007-07-29 22:38:31 +00:00
|
|
|
|
2011-04-02 09:55:00 +00:00
|
|
|
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
|
2007-07-29 22:38:31 +00:00
|
|
|
fi
|