2
0
mirror of https://github.com/garabik/grc.git synced 2024-11-10 21:26:52 +01:00
bash-color-grc/contrib/wrap-ccache

29 lines
511 B
Plaintext
Raw Normal View History

2015-01-25 18:36:02 +01:00
#!/bin/sh
# by Alexey Galakhov
wd="`dirname $0`"
ccache="`which ccache`"
grc="`which grc`"
grconf="conf.gcc"
if [ "`basename $1`" = "configure" ]; then
ccache=""
grconf="conf.configure"
fi
gropts=""
if perl -e 'use POSIX "isatty"; exit !isatty(1);'; then
gropts="$gropts --stdout"
fi
if perl -e 'use POSIX "isatty"; exit !isatty(2);'; then
gropts="$gropts --stderr"
fi
if [ ! -z "$grc" -a ! -z "$gropts" ]; then
grc="$grc -s -e -c $wd/$grconf"
else
grc=""
fi
exec $grc $ccache "$@"