]> git.ipfire.org Git - people/ms/ipfire-3.x.git/commitdiff
Updated icecream to 0.9.4.2.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 17 Jul 2009 00:47:58 +0000 (02:47 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 17 Jul 2009 00:47:58 +0000 (02:47 +0200)
Made some changes on the buildsystem to use icecream as
early as possible.

lfs/icecc
make.sh
tools/make-cluster
tools/make-include

index 25a87f3a631079478d3fbbae73e1d555696de582..4131620fbfa4edd423d1ba98b2eef883ffe6e17b 100644 (file)
--- a/lfs/icecc
+++ b/lfs/icecc
@@ -25,7 +25,7 @@
 include Config
 
 PKG_NAME   = icecream
-PKG_VER    = 0.9.4.1
+PKG_VER    = 0.9.4.2
 PKG_REL    = 0
 
 THISAPP    = $(PKG_NAME)-$(PKG_VER)
@@ -52,6 +52,8 @@ define LONG_DESC
 endef
 
 PREFIX     = $(TOOLS_DIR)/usr
+CFLAGS    := $(subst -fPIC,,$(CFLAGS)) -static
+CXXFLAGS  := $(subst -fPIC,,$(CXXFLAGS)) -static
 
 ###############################################################################
 # Top-level Rules
@@ -87,6 +89,8 @@ $(OBJECT): $(objects)
        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)
diff --git a/make.sh b/make.sh
index 8dca70d1f4c5b034d0636faf8892e32bc96661fc..15514ad56508697c98fe9f243a2924387f3de552 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}-8"        # Toolchain
+TOOLCHAINVERSION="${VERSION}-9"        # Toolchain
 SLOGAN="Gluttony"              # Software slogan
 
 # Include funtions
@@ -51,10 +51,10 @@ toolchain_build() {
        SAVE_SKIP_PACKAGE_LIST=$SKIP_PACKAGE_LIST
        SKIP_PACKAGE_LIST=
 
-       SAVE_CCACHE_PREFIX=$CCACHE_PREFIX
-       unset CCACHE_PREFIX
-
        toolchain_make stage1
+       toolchain_make icecc
+       iceccd_start                    # Start iceccd
+       icecc_use host                  # Use the host's tools
        toolchain_make ccache
        toolchain_make binutils         PASS=1
        toolchain_make gcc              PASS=1
@@ -66,6 +66,7 @@ toolchain_build() {
        toolchain_make gcc              PASS=2
        toolchain_make binutils         PASS=2
        toolchain_make test-toolchain   PASS=2
+       icecc_use toolchain             # Use the fresh gcc
        toolchain_make ncurses
        toolchain_make attr
        toolchain_make acl
@@ -92,16 +93,12 @@ toolchain_build() {
        toolchain_make flex
        toolchain_make bc
        toolchain_make xz
-       toolchain_make icecc
        toolchain_make autoconf
        toolchain_make automake
        toolchain_make strip
 
        export PATH=$ORG_PATH SKIP_PACKAGE_LIST=$SAVE_SKIP_PACKAGE_LIST
        unset SAVE_SKIP_PACKAGE_LIST
-
-       CCACHE_PREFIX=$SAVE_CCACHE_PREFIX
-       unset SAVE_CCACHE_PREFIX
 }
 
 ################################################################################
@@ -118,7 +115,9 @@ base_build() {
 
        build_spy stage ${STAGE}
 
-       iceccd_stop
+       # Start distributed compiling with toolchain
+       iceccd_start
+       icecc_use toolchain
 
        ipfire_make stage2
        ipfire_make scripts
@@ -132,9 +131,8 @@ base_build() {
        ipfire_make binutils
        ipfire_make gcc
 
-       icecc_build_native ${ICECC_TOOLCHAIN}
-       iceccd_start
-       ICECC_VERSION=${ICECC_TOOLCHAIN}
+       # Change to self-built gcc
+       icecc_use base
 
        ipfire_make make
        ipfire_make libtool
index a683937f283bf3ca0720bd66779ed65a7bb97335..56dab1efde4c9e57bfac59dd247b23d6e158eb0f 100644 (file)
 #                                                                             #
 ###############################################################################
 
-ICECC_TOOLCHAIN="${TOOLS_DIR}/${SNAME}-${TOOLCHAINVERSION}-iceccd.tar.gz"
+function ccache_disable() {
+       CCACHE=off
+}
+
+function ccache_enable() {
+       unset CCACHE
+}
+
+function icecc_toolchain() {
+       local chroot
+       local file
+
+       while [ $# -gt 0 ]; do
+               case "${1}" in
+                       --chroot)
+                               chroot=1
+                               ;;
+                       *)
+                               file=${1}
+                               ;;                      
+               esac
+               shift
+       done
+
+       if [ -e "${file}" ]; then
+               return
+       fi
+       
+       if [ "${chroot}" = "1" ]; then
+               chroot_cmd ${TOOLS_DIR}/usr/lib/icecc/icecc-create-env ${file} \
+                       --gcc=${ICECC_CC} --gxx=${ICECC_CXX} --as=${ICECC_AS}
+       else
+               ${TOOLS_DIR}/usr/lib/icecc/icecc-create-env ${file} \
+                       --gcc=${ICECC_CC} --gxx=${ICECC_CXX} --as=${ICECC_AS}
+       fi
 
-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}
+       ICECC_VERSION=${file}
 }
 
 function iceccd_start() {
        if [ -n "$(pidof iceccd)" ]; then
                return
        fi
-       local toolchain=${1}
-       ICECC_VERSION=${toolchain} ${TOOLS_DIR}/usr/sbin/iceccd -vvv -d -s ${ICECC_SCHEDULER} -m ${ICECC_JOBS-5}
+       ${TOOLS_DIR}/usr/sbin/iceccd -vvv -d -s ${ICECC_SCHEDULER} -m ${ICECC_JOBS-5}
 }
 
 function iceccd_stop() {
        killall iceccd 2>/dev/null
 }
+
+function icecc_disable() {
+       ICECC=off
+}
+
+function icecc_enable() {
+       unset ICECC
+       iceccd_start
+}
+
+function icecc_use() {
+       local stage=${1}
+       local options
+       local file=${TOOLS_DIR}/${SNAME}-${TOOLCHAINVERSION}-${stage}.tar.gz
+
+       case "${stage}" in
+               toolchain)
+                       ICECC_AS=${TOOLS_DIR}/bin/as
+                       ICECC_CC=${TOOLS_DIR}/bin/gcc
+                       ICECC_CXX=${TOOLS_DIR}/bin/g++
+                       ;;
+               base)
+                       ICECC_AS=/usr/bin/as
+                       ICECC_CC=/usr/bin/gcc
+                       ICECC_CXX=/usr/bin/g++
+                       options=--chroot
+                       ;;
+               host)
+                       ICECC_AS=/usr/bin/as
+                       ICECC_CC=/usr/bin/gcc
+                       ICECC_CXX=/usr/bin/g++
+                       file=${TOOLS_DIR}/${SNAME}-${TOOLCHAINVERSION}-${HOSTNAME}.tar.gz
+                       ;;
+       esac
+       icecc_toolchain ${options} ${file} >/dev/null
+}
index 3c539531982ec0237b0a8086a1d0cb91ea19f437..c3530ca85a0a391abd7a9ff140346b25269bf678 100644 (file)
@@ -107,6 +107,11 @@ logger() {
        echo "$(date -u '+%b %e %T') $*" >> $logfile
 }
 
+function ifdef() {
+       local var=${1}
+       [ -n "${!var}" ] &&     echo "${var}=${!var}"
+}
+
 ################################################################################
 # This is the function that sets the environment of a chroot and enters it     #
 ################################################################################
@@ -117,10 +122,18 @@ entershell() {
                exiterror "No such file or directory: $LFS/usr/src/lfs/"
        fi
 
-       COMMAND=${@-bash} # Run command, given as parameters.
-       
        echo -ne "Entering ${BOLD}$MACHINE${NORMAL} LFS chroot, type exit to return to host environment\n"
        
+       chroot_cmd ${@-bash} # Run command, given as parameters.
+
+       if [ $? -ne 0 ]; then
+               exiterror "chroot error"
+       else
+               stdumount
+       fi
+} # End of entershell()
+
+function chroot_cmd() {
        chroot $LFS $TOOLS_DIR/bin/env -i \
                HOME=/root \
                TERM=$TERM \
@@ -134,6 +147,8 @@ entershell() {
                CCACHE_DIR=/usr/src/ccache \
                CCACHE_PREFIX=${CCACHE_PREFIX} \
                CCACHE_HASHDIR=${CCACHE_HASHDIR} \
+               $(ifdef ICECC_CC) \
+               $(ifdef ICECC_CXX) \
                PARALLELISMFLAGS=$PARALLELISMFLAGS \
                LINKER=$LINKER \
                TOOLS_DIR=$TOOLS_DIR \
@@ -145,19 +160,8 @@ entershell() {
                IFS_HOST="$IFS_HOST" \
                IFS_TARGET="$IFS_TARGET" \
                KVER=$KVER \
-               STAGE=$STAGE \
-               STAGE_ORDER=$STAGE_ORDER \
-               LOGFILE=$(echo $LOGFILE | sed "s,$BASEDIR,/usr/src,g") \
-               $COMMAND
-
-       if [ $? -ne 0 ]; then
-               exiterror "chroot error"
-       else
-               stdumount
-       fi
-} # End of entershell()
-
-
+               $@
+}
 
 ################################################################################
 # Common checking before entering the chroot and compilling                    #
@@ -279,12 +283,16 @@ toolchain_make() {
                KVER="${KVER}" \
                EMB="${EMB}" \
                \
+               $(ifdef CCACHE) \
                CCACHE_DIR="${BASEDIR}/ccache" \
-               $([ -n "${CCACHE_PREFIX}" ] && echo CCACHE_PREFIX="${CCACHE_PREFIX}") \
                CCACHE_HASHDIR="${CCACHE_HASHDIR}" \
-               ICECC="${ICECC}" \
-               $([ -n "${ICECC_VERSION}" ] && echo ICECC_VERSION="${ICECC_VERSION}") \
+               $(ifdef CCACHE_PREFIX) \
+               \
+               $(ifdef ICECC) \
+               $(ifdef ICECC_VERSION) \
                USE_SCHEDULER="${ICECC_SCHEDULER}" \
+               $(ifdef ICECC_CC) \
+               $(ifdef ICECC_CXX) \
                \
                LINKER="${LINKER}" \
                MACHINE="${MACHINE}" \
@@ -355,11 +363,16 @@ ipfire_make() {
                KVER="${KVER}" \
                EMB="${EMB}" \
                \
+               $(ifdef CCACHE) \
                CCACHE_DIR="/usr/src/ccache" \
-               $([ -n "${CCACHE_PREFIX}" ] && echo CCACHE_PREFIX="${CCACHE_PREFIX}") \
                CCACHE_HASHDIR="${CCACHE_HASHDIR}" \
-               $([ -n "${ICECC_VERSION}" ] && echo ICECC_VERSION="${ICECC_VERSION}") \
+               $(ifdef CCACHE_PREFIX) \
+               \
+               $(ifdef ICECC) \
+               $(ifdef ICECC_VERSION) \
                USE_SCHEDULER="${ICECC_SCHEDULER}" \
+               $(ifdef ICECC_CC) \
+               $(ifdef ICECC_CXX) \
                \
                LINKER="${LINKER}" \
                MACHINE="${MACHINE}" \