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)
endef
PREFIX = $(TOOLS_DIR)/usr
+CFLAGS := $(subst -fPIC,,$(CFLAGS)) -static
+CXXFLAGS := $(subst -fPIC,,$(CXXFLAGS)) -static
###############################################################################
# Top-level Rules
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)
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
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
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
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
}
################################################################################
build_spy stage ${STAGE}
- iceccd_stop
+ # Start distributed compiling with toolchain
+ iceccd_start
+ icecc_use toolchain
ipfire_make stage2
ipfire_make scripts
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
# #
###############################################################################
-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
+}
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 #
################################################################################
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 \
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 \
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 #
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}" \
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}" \