Index: catalyst =================================================================== --- catalyst (revision 1260) +++ catalyst (working copy) @@ -113,6 +113,10 @@ print "Distcc support enabled." conf_values["DISTCC"]="1" + if "icecream" in string.split(conf_values["options"]): + print "Icecream compiler cluster support enabled." + conf_values["ICECREAM"]="1" + if "kerncache" in string.split(conf_values["options"]): print "Kernel cache support enabled." conf_values["KERNCACHE"]="1" Index: modules/generic_stage_target.py =================================================================== --- modules/generic_stage_target.py (revision 1260) +++ modules/generic_stage_target.py (working copy) @@ -202,6 +202,11 @@ # for the chroot: self.env["CCACHE_DIR"]="/var/tmp/ccache" + if self.settings.has_key("ICECREAM"): + self.mounts.append("/var/cache/icecream") + self.mountmap["/var/cache/icecream"]="/var/cache/icecream" + self.env["PATH"]="/usr/lib/icecc/bin:"+self.env["PATH"] + def override_cbuild(self): if self.makeconf.has_key("CBUILD"): self.settings["CBUILD"]=self.makeconf["CBUILD"] Index: modules/catalyst_support.py =================================================================== --- modules/catalyst_support.py (revision 1260) +++ modules/catalyst_support.py (working copy) @@ -154,6 +155,7 @@ valid_config_file_values.append("KERNCACHE") valid_config_file_values.append("CCACHE") valid_config_file_values.append("DISTCC") +valid_config_file_values.append("ICECREAM") valid_config_file_values.append("ENVSCRIPT") valid_config_file_values.append("AUTORESUME") valid_config_file_values.append("FETCH") Index: targets/support/chroot-functions.sh =================================================================== --- targets/support/chroot-functions.sh (revision 1260) +++ targets/support/chroot-functions.sh (working copy) @@ -99,6 +99,23 @@ chmod a+x /usr/lib/distcc/bin/${CHOST}-wrapper for i in cc gcc g++ c++; do ln -s ${CHOST}-wrapper ${i}; done fi + + if [ -n "${clst_ICECREAM}" ] + then + clst_root_path=/ run_emerge --oneshot --nodeps sys-devel/icecream || exit 1 + + # This sets up automatic cross-icecc-fu according to + # http://gentoo-wiki.com/HOWTO_Setup_An_ICECREAM_Compile_Cluster#Icecream_and_cross-compiling + CHOST=$(portageq envvar CHOST) + LIBDIR=$(get_libdir) + cd /usr/${LIBDIR}/icecc/bin + rm cc gcc g++ c++ 2>/dev/null + echo -e '#!/bin/bash\nexec /usr/'${LIBDIR}'/icecc/bin/'${CHOST}'-g${0:$[-2]} "$@"' > ${CHOST}-wrapper + chmod a+x ${CHOST}-wrapper + for i in cc gcc g++ c++; do ln -s ${CHOST}-wrapper ${i}; done + export PATH="/usr/lib/icecc/bin:${PATH}" + export PREROOTPATH="/usr/lib/icecc/bin" + fi } setup_myemergeopts(){ @@ -166,6 +183,15 @@ rm /usr/lib/distcc/bin/*-wrapper } +cleanup_icecream() { + LIBDIR=$(get_libdir) + for i in cc gcc c++ g++; do + rm /usr/${LIBDIR}/icecc/bin/${i} + ln -s /usr/bin/icecc /usr/${LIBDIR}/icecc/bin/${i} + done + rm /usr/${LIBDIR}/icecc/bin/*-wrapper +} + update_env_settings(){ /usr/sbin/env-update source /etc/profile Index: targets/stage2/stage2-preclean-chroot.sh =================================================================== --- targets/stage2/stage2-preclean-chroot.sh (revision 1260) +++ targets/stage2/stage2-preclean-chroot.sh (working copy) @@ -15,4 +15,10 @@ cleanup_distcc fi +if [ -n "${clst_ICECREAM}" ] +then + run_emerge -C sys-devel/icecream || exit 1 + cleanup_icecream +fi + rm -f /var/log/emerge.log Index: targets/stage3/stage3-preclean-chroot.sh =================================================================== --- targets/stage3/stage3-preclean-chroot.sh (revision 1260) +++ targets/stage3/stage3-preclean-chroot.sh (working copy) @@ -15,4 +15,10 @@ cleanup_distcc fi +if [ -n "${clst_ICECREAM}" ] +then + run_emerge -C sys-devel/icecream || exit 1 + cleanup_icecream +fi + rm -f /var/log/emerge.log Index: targets/grp/grp-preclean-chroot.sh =================================================================== --- targets/grp/grp-preclean-chroot.sh (revision 1260) +++ targets/grp/grp-preclean-chroot.sh (working copy) @@ -8,4 +8,9 @@ cleanup_distcc fi +if [ -n "${clst_ICECREAM}" ] +then + cleanup_icecream +fi + gconftool-2 --shutdown Index: targets/livecd-stage1/livecd-stage1-preclean-chroot.sh =================================================================== --- targets/livecd-stage1/livecd-stage1-preclean-chroot.sh (revision 1260) +++ targets/livecd-stage1/livecd-stage1-preclean-chroot.sh (working copy) @@ -7,3 +7,8 @@ then cleanup_distcc fi + +if [ -n "${clst_ICECREAM}" ] +then + cleanup_icecream +fi Index: targets/embedded/embedded-preclean-chroot.sh =================================================================== --- targets/embedded/embedded-preclean-chroot.sh (revision 1260) +++ targets/embedded/embedded-preclean-chroot.sh (working copy) @@ -7,3 +7,8 @@ then cleanup_distcc fi + +if [ -n "${clst_ICECREAM}" ] +then + cleanup_icecream +fi Index: targets/tinderbox/tinderbox-preclean-chroot.sh =================================================================== --- targets/tinderbox/tinderbox-preclean-chroot.sh (revision 1260) +++ targets/tinderbox/tinderbox-preclean-chroot.sh (working copy) @@ -7,3 +7,8 @@ then cleanup_distcc fi + +if [ -n "${clst_ICECREAM}" ] +then + cleanup_icecream +fi