added distcc support, documentation forthcoming
authorJohn P. Davis <zhen@gentoo.org>
Thu, 29 Jan 2004 21:53:22 +0000 (21:53 +0000)
committerJohn P. Davis <zhen@gentoo.org>
Thu, 29 Jan 2004 21:53:22 +0000 (21:53 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@197 d1e1f19c-881f-0410-ab34-b69fee027534

catalyst
modules/catalyst_support.py
modules/targets.py
targets/grp/grp.sh
targets/stage1/stage1-chroot.sh
targets/stage1/stage1.sh
targets/stage2/stage2.sh
targets/stage3/stage3.sh

index 8337824ece92454a3e340f0b0aa58dacef6008ad..a64a329e2f45b30ba3d1d24a70a6e73be43fcec5 100755 (executable)
--- a/catalyst
+++ b/catalyst
@@ -68,6 +68,10 @@ if "pkgcache" in string.split(myspec["options"]):
        print "Package cache support enabled."
        myspec["PKGCACHE"]="1"
 
+if "distcc" in string.split(myspec["options"]):
+       print "Distcc support enabled."
+       myspec["DISTCC"]="1"
+
 if sys.argv[1] in ["-f", "--file" ]:
        try:
                addlargs=read_spec(sys.argv[2])
index 60456e5539bdd65607aeb96b441dbb072894bf55..da049ff7faba58b24ecd9c55e84fb2010636fe14 100644 (file)
@@ -21,6 +21,7 @@ required_config_file_values=["storedir","sharedir","distdir","portdir"]
 valid_config_file_values=required_config_file_values[:]
 valid_config_file_values.append("PKGCACHE")
 valid_config_file_values.append("CCACHE")
+valid_config_file_values.append("DISTCC")
 valid_config_file_values.append("options")
 
 verbosity=1
index 9e74042493809ed0b1f46cc3accd44eeab4e4893..622db18baf4163866435ccd4b92f310ce4c84177 100644 (file)
@@ -104,10 +104,11 @@ class generic_stage_target(generic_target):
                if self.settings.has_key("CCACHE"):
                        self.mounts.append("/root/.ccache")
                        self.mountmap["/root/.ccache"]="/root/.ccache"
+               
                if self.settings["target"]=="grp":
                        self.mounts.append("/tmp/grp")
                        self.mountmap["/tmp/grp"]=self.settings["target_path"]
-                       
+       
        def mount_safety_check(self):
                mypath=self.settings["chroot_path"]
                #check and verify that none of our paths in mypath are mounted. We don't want to clean up with things still
@@ -204,7 +205,7 @@ class generic_stage_target(generic_target):
                if self.settings.has_key("CXXFLAGS"):
                        myf.write('CXXFLAGS="'+self.settings["CXXFLAGS"]+'"\n')
                else:
-                       myf.write('CXXFLAGS="$CFLAGS"\n')
+                       myf.write('CXXFLAGS="${CFLAGS}"\n')
                myf.close()
                
        def clean(self):
index 183ac0f8692d088af333787275f0038e31392573..d1342825d03af832bda558ed0ffcc4f96d23a364 100755 (executable)
@@ -1,6 +1,6 @@
 # Copyright 1999-2003 Gentoo Technologies, Inc.
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/grp/Attic/grp.sh,v 1.4 2004/01/10 22:23:44 drobbins Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/grp/Attic/grp.sh,v 1.5 2004/01/29 21:53:22 zhen Exp $
 
 case $1 in
 enter)
@@ -21,6 +21,15 @@ run)
                export FEATURES="ccache"
                emerge --oneshot --nodeps ccache || exit 1
        fi
+       if [ -n "${clst_DISTCC}" ]
+        then   
+                export FEATURES="distcc"
+                export DISTCC_HOSTS="${clst_distcc_hosts}"
+                emerge --oneshot --nodeps distcc || exit 1
+                echo "distcc:x:240:2:distccd:/dev/null:/bin/false" >> /etc/passwd
+                /usr/bin/distcc-config --install 2>&1 > /dev/null
+                /usr/bin/distccd 2>&1 > /dev/null
+        fi
        if [ ${clst_rel_type} = "hardened" ]
        then
                emerge --oneshot --nodeps hardened-gcc || exit 1
index 8342011af452238ce66911a5cda0533d6df7a0d9..364cc4c27c25713bb9bd64b76cb36c48098cc753 100755 (executable)
@@ -10,6 +10,15 @@ case $1 in
                        export FEATURES="ccache"        
                        emerge --oneshot --nodeps ccache || exit 1
                fi
+               if [ -n "${clst_DISTCC}" ]
+                then   
+                        export FEATURES="distcc"
+                        export DISTCC_HOSTS="${clst_distcc_hosts}"
+                        emerge --oneshot --nodeps distcc || exit 1
+                       echo "distcc:x:240:2:distccd:/dev/null:/bin/false" >> /etc/passwd
+                        /usr/bin/distcc-config --install 2>&1 > /dev/null
+                        /usr/bin/distccd 2>&1 > /dev/null
+                fi
                export ROOT=${2}
                install -d $ROOT
                if [ -n "${clst_PKGCACHE}" ]
index 60b71a797cb3c6a644b309661632e56455654b0e..314bd58bd18d5684dfbf74eac5a378cd5d6bf9e2 100755 (executable)
@@ -1,6 +1,6 @@
 # Copyright 1999-2003 Gentoo Technologies, Inc.
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/Attic/stage1.sh,v 1.7 2003/11/03 15:46:14 drobbins Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/Attic/stage1.sh,v 1.8 2004/01/29 21:53:22 zhen Exp $
 
 case $1 in
 enter)
@@ -15,7 +15,7 @@ run)
        cp ${clst_chroot_path}/etc/make.conf ${clst_chroot_path}/tmp/stage1root/etc
        cp -a ${clst_chroot_path}/etc/make.profile ${clst_chroot_path}/tmp/stage1root/etc
        # enter chroot, execute our build script
-       $clst_CHROOT ${clst_chroot_path} /tmp/stage1-chroot.sh build /tmp/stage1root
+       $clst_CHROOT ${clst_chroot_path} /tmp/stage1-chroot.sh build /tmp/stage1root
        [ $? -ne 0 ] && exit 1
        ;;
 preclean)
index 9aa1617093cb101e41a768abe1af586fdd1a32f9..25062431770590f3b8c7e4e1dd607ee31457bd18 100755 (executable)
@@ -1,6 +1,6 @@
 # Copyright 1999-2003 Gentoo Technologies, Inc.
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage2/Attic/stage2.sh,v 1.6 2003/11/06 02:31:20 drobbins Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage2/Attic/stage2.sh,v 1.7 2004/01/29 21:53:22 zhen Exp $
 
 case $1 in
 enter)
@@ -18,6 +18,15 @@ run)
                export FEATURES="ccache"        
                emerge --oneshot --nodeps ccache || exit 1
        fi
+       if [ -n "${clst_DISTCC}" ]
+       then
+               export FEATURES="distcc"
+               export DISTCC_HOSTS="${clst_distcc_hosts}"
+               emerge --oneshot --nodeps distcc || exit 1
+               echo "distcc:x:240:2:distccd:/dev/null:/bin/false" >> /etc/passwd
+               /usr/bin/distcc-config --install 2>&1 > /dev/null
+               /usr/bin/distccd 2>&1 > /dev/null
+       fi                                                                              
        if [ -n "${clst_PKGCACHE}" ]
        then
                export EMERGE_OPTS="--usepkg --buildpkg"
@@ -35,6 +44,10 @@ preclean)
        then
                emerge -C dev-util/ccache || exit 1
        fi
+       if [ -n "${clst_DISTCC}" ]
+       then
+               emerge -C sys-devel/distcc || exit 1
+       fi
 EOF
        [ $? -ne 0 ] && exit 1 
        ;;
index de20d6363a8e8882b47be49f0a4b450a14ed4231..91309fce01a1febba27c4c1eacd974071a2da814 100755 (executable)
@@ -1,6 +1,6 @@
 # Copyright 1999-2003 Gentoo Technologies, Inc.
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage3/Attic/stage3.sh,v 1.7 2003/11/06 03:45:15 drobbins Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage3/Attic/stage3.sh,v 1.8 2004/01/29 21:53:22 zhen Exp $
 
 case $1 in
 enter)
@@ -14,11 +14,6 @@ run)
        source /tmp/stage23
        export USE="-* \${clst_HOSTUSE} \${GRP_STAGE23_USE}"
        rm -f /tmp/stage23
-       if [ -n "${clst_CCACHE}" ]
-       then
-               export FEATURES="ccache"
-               emerge --oneshot --nodeps ccache || exit 1
-       fi
        if [ ${clst_rel_type} = "hardened" ]
        then
                emerge --oneshot --nodeps hardened-gcc || exit 1
@@ -28,7 +23,21 @@ run)
        #portage needs to be merged manually with USE="build" set to avoid frying our
        #make.conf. emerge system could merge it otherwise.
        USE="build" emerge portage
-       
+
+       if [ -n "${clst_CCACHE}" ]
+       then
+               export FEATURES="ccache"
+               emerge --oneshot --nodeps ccache || exit 1
+       fi
+       if [ -n "${clst_DISTCC}" ]
+        then   
+                export FEATURES="distcc"
+                export DISTCC_HOSTS="${clst_distcc_hosts}"
+                emerge --oneshot --nodeps distcc || exit 1
+                echo "distcc:x:240:2:distccd:/dev/null:/bin/false" >> /etc/passwd
+                /usr/bin/distcc-config --install 2>&1 > /dev/null
+                /usr/bin/distccd 2>&1 > /dev/null
+        fi
        if [ -n "${clst_PKGCACHE}" ]
        then
                emerge system --usepkg --buildpkg || exit 1
@@ -46,6 +55,11 @@ preclean)
        then
                emerge -C dev-util/ccache || exit 1
        fi
+       if [ -n "${clst_DISTCC}" ]
+       then
+               emerge -C sys-devel/distcc || exit 1
+               userdel distcc
+       fi
 EOF
        [ $? -ne 0 ] && exit 1
        ;;