From: Michael Tremer Date: Tue, 7 Jul 2009 18:27:03 +0000 (+0200) Subject: Replaced distcc by icecc. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f90d4c9ba212b53fbbbf52377802e7a240778acd;p=ipfire-3.x.git Replaced distcc by icecc. --- diff --git a/.config-default b/.config-default index b9d3d77a5..3227faa0f 100644 --- a/.config-default +++ b/.config-default @@ -102,21 +102,19 @@ #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 index 000000000..69a467db1 --- /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 . # +# # +############################################################################### + +############################################################################### +# 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 0f890628e..8c8ad8a08 100755 --- 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 } diff --git a/tools/make-buildspy b/tools/make-buildspy index f3993ef93..25825c09a 100755 --- a/tools/make-buildspy +++ b/tools/make-buildspy @@ -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 index 000000000..d9a34978b --- /dev/null +++ b/tools/make-cluster @@ -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 . # +# # +############################################################################### + +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 +} diff --git a/tools/make-constants b/tools/make-constants index e5fced05f..95015fe56 100644 --- a/tools/make-constants +++ b/tools/make-constants @@ -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) diff --git a/tools/make-git b/tools/make-git index a8afd7937..c036e5b2a 100755 --- a/tools/make-git +++ b/tools/make-git @@ -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 diff --git a/tools/make-include b/tools/make-include index bd113cda3..c68f3aab5 100644 --- a/tools/make-include +++ b/tools/make-include @@ -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 diff --git a/tools/make-interactive b/tools/make-interactive index f5312b687..4fa0e827e 100644 --- a/tools/make-interactive +++ b/tools/make-interactive @@ -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