]> git.ipfire.org Git - people/ms/ipfire-3.x.git/commitdiff
Added script to run distccd.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 3 Oct 2008 10:17:37 +0000 (10:17 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 3 Oct 2008 10:17:37 +0000 (10:17 +0000)
tools/make-compilers [changed mode: 0644->0755]
tools/make-include
tools/make-interactive

old mode 100644 (file)
new mode 100755 (executable)
index 762a8ee..4ba20a4
@@ -46,3 +46,40 @@ distcc_mon() {
                beautify message FAIL
        fi
 }
+
+distccd_start() {
+       echo "Running distcc daemon"
+       TOOLS_DIR=$TOOLS_DIR $BASEDIR/tools/make-compilers &
+       if [ "$?" -eq "0" ]; then
+               beautify message DONE
+       else
+               beautify message FAIL
+       fi
+}
+
+distccd_stop() {
+       echo "Stopping distcc daemon"
+       killall distccd
+       if [ "$?" -eq "0" ]; then
+               beautify message DONE
+       else
+               beautify message FAIL
+       fi
+}
+
+if [ "$(basename $0)" == "make-compilers" ]; then
+       # Exit, when distccd is already running
+       pidof distccd >/dev/null && exit 1
+
+       # Run distccd
+       DISTCCD_PATH=$TOOLS_DIR/bin:$(ls $TOOLS_DIR/libexec/gcc/*-pc-linux-gnu/*/) \
+               $TOOLS_DIR/usr/bin/distccd --daemon --allow 0.0.0.0/0 \
+               --user nobody --nice 10 --jobs 4 &>/dev/null
+
+       # When $TOOLS_DIR is not available (esp. gcc) --> exit
+       while pidof distccd >/dev/null && [ -x $TOOLS_DIR/bin/gcc ]; do
+               sleep 10
+       done
+
+       distccd_stop
+fi
index a9169d168a9cc6c1b33673485de70185611912fc..db15b48fd3bab7a8e1381c442f9411afdffc1eb1 100644 (file)
@@ -655,7 +655,10 @@ build() {
                        prepareenv
                fi
        fi
-       
+
+       # Run distcc daemon
+       distccd_start
+
        beautify build_stage "Building base"
        base_build
 
index aadbb282d7af51f70e9da64d5b872b19a2eab676..5dd96c89a960d455c29e4a27ebd0fa9898c8806a 100644 (file)
@@ -61,13 +61,25 @@ batch)
        esac
        ;;
 
-stats)
-       # show some stats about the compiler(s)
+ccache)
+       # ccache options
        case "$2" in
-               ccache)
+               stats)
                        ccache_stats
                        ;;
-               distcc)
+       esac
+       ;;
+
+distcc|distccd)
+       # distcc(d) commands
+       case "$2" in
+               start)
+                       distccd_start
+                       ;;
+               stop)
+                       distccd_stop
+                       ;;
+               stats|mon)
                        distcc_mon
                        ;;
        esac