2007年4月10日火曜日

ccontorol

Etch Debian 4.0 release
ということで開発環境を思いっきり再構築

distccとccacheを使うのだが、ccontrolをいれてみる

$ccontrol-init
Looking for C compiler.../usr/bin/cc...which is a link to /usr/bin/gcc-4.1
Looking for C++ compiler...None found! Giving up.

cppはあるけどc++がないので
cppから無理矢理リンクを作って再実行

$ ccontrol-init
Looking for C compiler.../usr/bin/cc...which is a link to /usr/bin/gcc-4.1
Looking for C++ compiler.../usr/bin/c++...which is a link to /usr/bin/cpp-4.1
Looking for linker...Found /usr/bin/ld
Looking for make...Found /usr/bin/make
Looking for distcc...Found /usr/bin/distcc
Looking for ccache...Found /usr/bin/ccache
Counting CPUs on this machine...found 1
Looking for distcc hosts...scanning network 192.168.176.0...

こいつ、かってにvmnet1のアドレスをつかった。eth0使ってくれ

~/.ccontrol/defaultの内容

[*]
cc = /usr/bin/gcc-4.1
c++ = /usr/bin/cpp-4.1
ld = /usr/bin/ld
make = /usr/bin/make
ccache = /usr/bin/ccache

distccがない.... 手動で編集して
distcc= /usr/bin/distcc
distcc-hosts= AAA BBB CCC localhost
cpus = 4
を追加

dpkg-buildpackage とか fakerootするためsshでトンネルさせられないので
/etc/defaults/distcc を編集して distcc-hostsに書いてある
dstccdのデーモンをあげておく。(sshは遅いからこちらのほうがいい)

/etc/defaults/distccは
localhost以外は
ALLOWEDNETS= とか LISTNER= を適切に設定

/usrbin/gccのリンクを変える
#/usr/bin
#ln -sf ccontrol gcc

あとは適宜?

$MAKEFLAGS=-j12 dpkg-buildpackage ....
とかすると動く
$distccmon-gnome &
を見てると状況がわかる。

0 件のコメント: