# 1_local.plugin.zsh
-# 2015-03-17, alex@barton.de
+# 2015-03-27, alex@barton.de
[ -d "/usr/local/home" -a ! -d "/usr/local/home/$LOGNAME" ] \
&& mkdir "/usr/local/home/$LOGNAME" >/dev/null 2>&1
# Setup XDG cache directory
export XDG_CACHE_HOME="$LOCAL_HOME/.cache"
-
-# Setup environment for ccache, if installed
-type ccache >/dev/null && export CCACHE_DIR="$XDG_CACHE_HOME/ccache"
--- /dev/null
+# ccache.plugin.zsh
+# 2015-03-27, alex@barton.de
+
+if type ccache >/dev/null; then
+ # Setup environment for ccache, if installed
+ export CCACHE_DIR="$XDG_CACHE_HOME/ccache"
+
+ # Search for directory with wrapper commands and prepend it to "PATH"
+ for d in \
+ /usr/local/opt/ccache/libexec \
+ /usr/local/lib/ccache \
+ /opt/ccache/libexec \
+ /usr/libexec/ccache \
+ /usr/lib/ccache \
+ ; do
+ if [ -d "$d" ]; then
+ PATH="$d:$PATH"
+ break
+ fi
+ done
+fi