]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
Replaced distcc by icecc.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 7 Jul 2009 18:27:03 +0000 (20:27 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 7 Jul 2009 18:27:03 +0000 (20:27 +0200)
.config-default
lfs/icecc [new file with mode: 0644]
make.sh
tools/make-buildspy
tools/make-cluster [new file with mode: 0644]
tools/make-constants
tools/make-git
tools/make-include
tools/make-interactive

index b9d3d77a56a9ced70a3d0d3e12148181e840add8..3227faa0f9ad9ce6985464fbb2d92f21829d31c5 100644 (file)
 #PARALLELISMFLAGS=-j3
 
 ###############################################################################
-# Distcc Config                                                               #
+# Icecream Config                                                             #
 ###############################################################################
-# DISTCC_PORT: Allows the definition of an other port than the default one.   #
-# If you change this, you need to restart the local distcc daemon.            #
-# Default is tcp/3632. "0" disables the start of the distcc daemon.           #
+# ICECC_PORT: Allows the definition of an other port than the default one.    #
+# If you change this, you need to restart the local icecream daemon.          #
+# Default is tcp/10245. "0" disables the start of the icecream daemon.        #
 #                                                                             #
-# DISTCC_HOSTS: Distcc lets you run some instances of gcc on other dedicated  #
-# machines. In this list you add the adresses of the hosts. Note that there   #
-# is no dns available in the chroot.                                          #
-# Default is compling on localhost only.                                      #
+# ICECC_SCHEDULER: The hostname of the central server, called scheduler.      #
 ###############################################################################
 
-#DISTCC_PORT=3632
-#DISTCC_JOBS=4
-#DISTCC_HOSTS="localhost"
+#ICECC_PORT=3632
+#ICECC_JOBS=4
+#ICECC_SCHEDULER="minerva.ipfire.org"
+#ICECC_PREFERRED_HOST="..."
 
 ###############################################################################
 # Mail                                                                        #
diff --git a/lfs/icecc b/lfs/icecc
new file mode 100644 (file)
index 0000000..69a467d
--- /dev/null
+++ b/lfs/icecc
@@ -0,0 +1,101 @@
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007, 2008, 2009 Michael Tremer & Christian Schmidt           #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+PKG_NAME   = icecc
+PKG_VER    = 0.9.4
+PKG_REL    = 0
+
+THISAPP    = $(PKG_NAME)-$(PKG_VER)
+DL_FILE    = $(THISAPP).tar.bz2
+DIR_APP    = $(DIR_SRC)/$(THISAPP)
+
+OBJECT     = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
+
+MAINTAINER =
+GROUP      = Development/Compilers
+CORE       = no
+EXTRA      = no
+DEBUG      = no
+BUILD_DEPS =
+DEPS       =
+
+URL        = ftp://ftp.suse.com/pub/projects/icecream
+LICENSE    = GPLv2+
+SHORT_DESC = A distributed C/C++ compiler based on distcc.
+
+define LONG_DESC
+       A distributed C/C++ compiler with a central server (called scheduler) \
+       that gets out the best server of the pool. Icecc is based on distcc. 
+endef
+
+PREFIX     = $(TOOLS_DIR)/usr
+CFLAGS    := $(subst -fPIC,,$(CFLAGS)) -static
+CXXFLAGS  := $(subst -fPIC,,$(CXXFLAGS)) -static
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE) \
+       $(THISAPP)-rename-scheduler.patch \
+       $(THISAPP)-dont-create-symlinks.patch
+
+download: $(objects)
+
+info:
+       $(DO_PKG_INFO)
+
+install: $(OBJECT)
+
+packages: $(PACKAGES)
+
+$(PACKAGES): $(OBJECT)
+       @$(DO_PACKAGE)
+
+$(objects):
+       @$(LOAD)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(OBJECT): $(objects)
+       @$(PREBUILD)
+       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && $(EXTRACTOR) $(DIR_DL)/$(DL_FILE)
+       cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-rename-scheduler.patch
+       cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-dont-create-symlinks.patch
+
+       cd $(DIR_APP) && \
+               CFLAGS="$(CFLAGS)" \
+               CXXFLAGS="$(CXXFLAGS)" \
+               ./configure \
+                       $(CONFIGURE_ARCH) \
+                       --prefix=$(PREFIX)
+       cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+       cd $(DIR_APP) && make install
+       rm -vf $(PREFIX)/bin/{{,g}cc,{c,g}++}
+       @rm -rf $(DIR_APP)
+       @$(POSTBUILD)
diff --git a/make.sh b/make.sh
index 0f890628e77d40553e5d349f9b438abee2991d98..8c8ad8a08a8fc1bc8f36d9575502bb21cb6fd89f 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -25,7 +25,7 @@
 NAME="IPFire"                  # Software name
 SNAME="ipfire"                 # Short name
 VERSION="3.0-prealpha2"                # Version number
-TOOLCHAINVERSION="${VERSION}-6"        # Toolchain
+TOOLCHAINVERSION="${VERSION}-7"        # Toolchain
 SLOGAN="Gluttony"              # Software slogan
 
 # Include funtions
@@ -53,7 +53,7 @@ toolchain_build() {
 
        toolchain_make stage1
        # make distcc first so that CCACHE_PREFIX works immediately
-       toolchain_make distcc
+       toolchain_make icecc
        toolchain_make ccache
        toolchain_make binutils         PASS=1
        toolchain_make gcc              PASS=1
@@ -92,6 +92,11 @@ toolchain_build() {
        toolchain_make bc
        toolchain_make xz
        toolchain_make strip
+
+       ICECC_CC="${TOOLS_DIR}/bin/gcc" \
+       ICECC_CXX="${TOOLS_DIR}/bin/g++" \
+               icecc_build_native ${ICECC_TOOLCHAIN}
+
        export PATH=$ORG_PATH SKIP_PACKAGE_LIST=$SAVE_SKIP_PACKAGE_LIST
        unset SAVE_SKIP_PACKAGE_LIST
 }
index f3993ef93a54f72cd113cbc3819d7f96d727b02c..25825c09a1389915c7cdec920d2cccfc7e8cdd0d 100755 (executable)
@@ -40,7 +40,6 @@ build_spy() {
 build_spy_send_profile() {
        build_spy target   ${TARGET}
        build_spy hostname ${HOSTNAME}
-       build_spy distcc   ${DISTCC_PORT-3632}
        build_spy jobs     ${DISTCC_JOBS}
        build_spy cpu      $(grep ^model\ name /proc/cpuinfo | head -n1 | \
                awk -F: '{ print $2 }' | $BASEDIR/tools/base64)
diff --git a/tools/make-cluster b/tools/make-cluster
new file mode 100644 (file)
index 0000000..d9a3497
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/bash
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2008  Michael Tremer & Christian Schmidt                      #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+ICECC_TOOLCHAIN="${TOOLS_DIR}/${SNAME}-${TOOLCHAINVERSION}-iceccd.tar.gz"
+
+function icecc_build_native() {
+       local file=${1}
+       cd /tmp
+       OUT=$(icecc --build-native)
+       #echo "$OUT"
+       mv -f $(tail -n 1 <<<$OUT | awk '{ print $NF }') ${file}
+}
+
+function iceccd_start() {
+       if [ -n "$(pidof iceccd)" ]; then
+               return
+       fi
+       local toolchain=${1}
+       ICECC_VERSION=${toolchain} iceccd -s minerva.ipfire.org -d -m ${ICECC_JOBS-5}
+}
+
+function iceccd_stop() {
+       killall iceccd 2>/dev/null
+}
index e5fced05ff108088c9f6b0a1894115ea6f86c98a..95015fe56d9d802fd03a580009342d09d30efa55 100644 (file)
@@ -54,10 +54,6 @@ BUILD_DEBUG=0
 # Default parallelism options
 PARALLELISMFLAGS=-j$(( $(grep processor < /proc/cpuinfo | wc -l) * 2 + 1 ))
 
-# Default distcc options
-DISTCC_PORT=3632
-DISTCC_JOBS=4
-
 # Default hostname
 HOSTNAME=$(hostname -f || hostname)
 
@@ -162,3 +158,6 @@ IMAGES_DIR=/images
 # Files that indicates that we are running or failed
 RUNNING=$BASEDIR/.running
 FAILED=$BASEDIR/.failed
+
+ICECC=off # icecc is currently disabled
+ICECC_SCHEDULER=$(${BASEDIR}/tools/resolver ${ICECC_SCHEDULER} 2>/dev/null)
index a8afd79378831628fa6e91a9fd797f266d4f5378..c036e5b2a6f46feae6c2f222369947addc21233b 100755 (executable)
@@ -54,7 +54,6 @@ git_pull() {
        if [ "$1" = "--batch" ]; then
                shift
                git pull $* | grep -q "Already up-to-date." || rm -f $FAILED
-               [ -e $FAILED ] || distccd_restart
                [ "$(expr $RANDOM % 25)" -eq "0" ] && git_gc
        else
                if [ "$CURRENT_BRANCH" == "master" ]; then
index bd113cda3a51eea355902aaa9a903999ba23881d..c68f3aab50fcdbe0374eb222ec70a9d1cf54bcf6 100644 (file)
@@ -56,6 +56,7 @@ mkdir $BASEDIR/log_${TARGET}/ 2>/dev/null
 . $BASEDIR/tools/make-buildspy
 . $BASEDIR/tools/make-check
 . $BASEDIR/tools/make-batch
+. $BASEDIR/tools/make-cluster
 . $BASEDIR/tools/make-compilers
 . $BASEDIR/tools/make-git
 . $BASEDIR/tools/make-packages
@@ -98,8 +99,8 @@ exiterror() {
 logger() {
        local logfile=$LOGFILE
        case "$1" in
-               --distcc)
-                       logfile=$BASEDIR/log_$TARGET/_build.00-distcc.log
+               --cluster)
+                       logfile=$BASEDIR/log_$TARGET/_build.00-cluster.log
                        shift
                        ;;
        esac
@@ -133,7 +134,6 @@ entershell() {
                CCACHE_DIR=/usr/src/ccache \
                CCACHE_PREFIX=${CCACHE_PREFIX} \
                CCACHE_HASHDIR=${CCACHE_HASHDIR} \
-               DISTCC_DIR=/usr/src/distcc \
                PARALLELISMFLAGS=$PARALLELISMFLAGS \
                LINKER=$LINKER \
                TOOLS_DIR=$TOOLS_DIR \
@@ -252,8 +252,6 @@ lfsmakecommoncheck()
                exiterror "Download error in $1"
        fi
 
-       distcc_reload &
-
        return 0        # pass all!
 } # End of lfsmakecommoncheck()
 
@@ -353,7 +351,9 @@ ipfire_make() {
                CCACHE_DIR="/usr/src/ccache" \
                CCACHE_PREFIX="${CCACHE_PREFIX}" \
                CCACHE_HASHDIR="${CCACHE_HASHDIR}" \
-               DISTCC_DIR="/usr/src/distcc" \
+               ICECC="${ICECC}" \
+               ICECC_VERSION="${ICECCD_TOOLCHAIN}" \
+               USE_SCHEDULER="${ICECC_SCHEDULER}" \
                \
                LINKER="${LINKER}" \
                MACHINE="${MACHINE}" \
@@ -427,7 +427,6 @@ package_make() {
                CCACHE_DIR="/usr/src/ccache" \
                CCACHE_PREFIX="${CCACHE_PREFIX}" \
                CCACHE_HASHDIR="${CCACHE_HASHDIR}" \
-               DISTCC_DIR="/usr/src/distcc" \
                \
                LINKER="${LINKER}" \
                MACHINE="${MACHINE}" \
@@ -597,13 +596,13 @@ prepareenv() {
 
        # Make some extra directories
        mkdir -p $BASEDIR/build_${TARGET}/{$TOOLS_DIR,cdrom,$INSTALLER_DIR,$IMAGES_DIR} 2>/dev/null
-       mkdir -p $BASEDIR/{cache,ccache,distcc} 2>/dev/null
+       mkdir -p $BASEDIR/{cache,ccache} 2>/dev/null
        mkdir -p $BASEDIR/cache/{toolchains,patches,tarballs} 2>/dev/null
        mkdir -p $BASEDIR/packages_${TARGET} 2>/dev/null
        mkdir -p $LFS/{$TOOLS_DIR,usr/src} 2>/dev/null
        mkdir -p $LFS/{dev,etc,proc,sys} 2>/dev/null
        mkdir -p $LFS/dev/pts 2>/dev/null
-       mkdir -p $LFS/usr/src/{cache,config,doc,lfs,log_${TARGET},src,ccache,distcc} 2>/dev/null
+       mkdir -p $LFS/usr/src/{cache,config,doc,lfs,log_${TARGET},src,ccache} 2>/dev/null
        mkdir -p $LFS/{$INSTALLER_DIR,cdrom,images,packages} 2>/dev/null
 
        mknod -m 600 $BASEDIR/build/dev/console c 5 1 2>/dev/null
@@ -615,7 +614,6 @@ prepareenv() {
        mount --bind /sys                                       $LFS/sys
        mount --bind $BASEDIR/cache                             $LFS/usr/src/cache
        mount --bind $BASEDIR/ccache                            $LFS/usr/src/ccache
-       mount --bind $BASEDIR/distcc                            $LFS/usr/src/distcc
        mount --bind $BASEDIR/config                            $LFS/usr/src/config
        mount --bind $BASEDIR/doc                               $LFS/usr/src/doc
        mount --bind $BASEDIR/lfs                               $LFS/usr/src/lfs
@@ -630,8 +628,7 @@ prepareenv() {
        # Run LFS static binary creation scripts one by one
        export CCACHE_DIR=$BASEDIR/ccache
        export CCACHE_HASHDIR=1
-       export CCACHE_PREFIX="distcc"
-       export DISTCC_DIR=$BASEDIR/distcc
+       export CCACHE_PREFIX="icecc"
 
        # Remove pre-install list of installed files in case user erase some files before rebuild
        rm -f $LFS/usr/src/lsalr 2>/dev/null
@@ -654,7 +651,6 @@ build() {
        build_spy_send_profile
        build_spy state compiling
        build_spy start
-       distcc_get_hosts &
 
        if [ -f $BASEDIR/log_${TARGET}/02_base/stage2 ]; then
                prepareenv
@@ -676,8 +672,8 @@ build() {
                fi
        fi
 
-       # Run distcc daemon
-       distccd_start
+       # Run icecc daemon
+       iceccd_start
 
        beautify build_stage "Building base"
        base_build
index f5312b6877a59d90082620445d191891f1c707fc..4fa0e827ebcf094ea036a387174df71991d86d8e 100644 (file)
@@ -106,24 +106,6 @@ config)
        esac
        ;;
 
-distcc|distccd)
-       # distcc(d) commands
-       case "$2" in
-               start)
-                       distccd_start
-                       ;;
-               stop)
-                       distccd_stop
-                       ;;
-               restart)
-                       distccd_restart
-                       ;;
-               stats|mon)
-                       distcc_mon
-                       ;;
-       esac
-       ;;
-
 clean)
        for i in $(mount | grep $BASEDIR | cut -d " " -f 1); do
                umount $i