ccache is a compiler cache. It speeds up recompilation by caching previous
complilations and detecting when the same compilation is being done again.
Supported languages are C, C++, Objective-C and Objective-C++.
作者:帅得不敢出门 群31843264 欢迎c/c++/linuxer前来灌水 转载请保留此信息
tar -xvf ccache-3.1.4.tar.bz2
cd ccache-3.1.4
./configure
make
make install
默认装在/usr/local/bin/下,而系统默认的gcc装在/usr/bin 下
echo $PATH
/usr/lib/mpi/gcc/openmpi/bin:/home/zengming/bin:/usr/local/bin:/usr/bin:/bin:\
/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/jvm/jre/bin
有两个方法让编译时使用ccache,一就是在编译器名前加ccache,二就是创建链接指向
ccache
上面可知,/usr/local/bin 在/usr/bin 前,我采用的是创建链接的方法,直接在
/usr/local/bin 中创建
cd /usr/local/bin
ln -s ccache /usr/local/bin/gcc
ln -s ccache /usr/local/bin/g++
ln -s ccache /usr/local/bin/cc
ln -s ccache /usr/local/bin/c++
我的交叉编译器装在/opt/toolchains/arm920t-eabi/bin/ 下
cd /usr/local/bin/
ln -s ccache /usr/local/bin/arm-linux-gcc
ln -s ccache /usr/local/bin/arm-linux-g++
ln -s ccache /usr/local/bin/arm-linux-c++
ln -s ccache /usr/local/bin/arm-linux-cpp
注意交叉编译时,要确保PATH中 /usr/local/bin 在 交叉编译工具链目录前
这样ccache才有作用
阅读(3118) | 评论(0) | 转发(0) |