Signed-off-by: Jo-Philipp Wich <jo@mein.io>
echo "compiler_check = %compiler% -dumpmachine; %compiler% -dumpversion" >> "$HOME/.ccache/ccache.conf"
for dir in $(make --no-print-directory val.TOOLCHAIN_DIR val.STAGING_DIR val.STAGING_DIR_HOST V=s | grep staging_dir/); do
- if [ ! -L "$dir/ccache" ]; then
+ if [ ! -L "$dir/ccache" ] || [ -L "$dir/ccache" -a ! -d "$dir/ccache" ]; then
mkdir -vp "$dir"
rm -vrf "$dir/ccache"
ln -vs "$HOME/.ccache" "$dir/ccache"