copy from http://ccache.samba.org/