#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 #
--- /dev/null
+###############################################################################
+# #
+# 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)
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
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
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
}
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)
--- /dev/null
+#!/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
+}
# 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)
# 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)
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
. $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
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
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 \
exiterror "Download error in $1"
fi
- distcc_reload &
-
return 0 # pass all!
} # End of lfsmakecommoncheck()
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}" \
CCACHE_DIR="/usr/src/ccache" \
CCACHE_PREFIX="${CCACHE_PREFIX}" \
CCACHE_HASHDIR="${CCACHE_HASHDIR}" \
- DISTCC_DIR="/usr/src/distcc" \
\
LINKER="${LINKER}" \
MACHINE="${MACHINE}" \
# 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
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
# 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
build_spy_send_profile
build_spy state compiling
build_spy start
- distcc_get_hosts &
if [ -f $BASEDIR/log_${TARGET}/02_base/stage2 ]; then
prepareenv
fi
fi
- # Run distcc daemon
- distccd_start
+ # Run icecc daemon
+ iceccd_start
beautify build_stage "Building base"
base_build
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