#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.24-ipfire1
-# Thu Jan 31 18:38:32 2008
+# Linux kernel version: 2.6.24
+# Sat Feb 16 21:37:18 2008
#
# CONFIG_64BIT is not set
CONFIG_X86_32=y
# CONFIG_M586 is not set
# CONFIG_M586TSC is not set
# CONFIG_M586MMX is not set
-# CONFIG_M686 is not set
+CONFIG_M686=y
# CONFIG_MPENTIUMII is not set
-CONFIG_MPENTIUMIII=y
+# CONFIG_MPENTIUMIII is not set
# CONFIG_MPENTIUMM is not set
# CONFIG_MPENTIUM4 is not set
# CONFIG_MK6 is not set
CONFIG_X86_CMPXCHG=y
CONFIG_X86_L1_CACHE_SHIFT=7
CONFIG_X86_XADD=y
+CONFIG_X86_PPRO_FENCE=y
CONFIG_X86_WP_WORKS_OK=y
CONFIG_X86_INVLPG=y
CONFIG_X86_BSWAP=y
CONFIG_NETFILTER_XT_MATCH_REALM=m
# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
CONFIG_NETFILTER_XT_MATCH_STATE=m
-CONFIG_NETFILTER_XT_MATCH_LAYER7=m
-# CONFIG_NETFILTER_XT_MATCH_LAYER7_DEBUG is not set
CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
CONFIG_NETFILTER_XT_MATCH_STRING=m
CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
KGCC = gcc
+ifeq "$(STAGE)" "toolchain"
+ifneq "$(MACHINE_REAL)" "$(MACHINE)"
+ifeq "$(CROSS)" ""
+ CC="${IFS_TARGET}-gcc"
+ CXX="${IFS_TARGET}-g++"
+ AR="${IFS_TARGET}-ar"
+ AS="${IFS_TARGET}-as"
+ RANLIB="${IFS_TARGET}-ranlib"
+ LD="${IFS_TARGET}-ld"
+ STRIP="${IFS_TARGET}-strip"
+endif
+endif
+endif
+
###############################################################################
# Common Macro Definitions
###############################################################################
DIR_APP = $(DIR_SRC)/$(THISAPP)
ifeq "$(STAGE)" "toolchain"
+ifeq "$(firstword $(MAKEFILE_LIST))" "$(PKG_NAME)"
TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)-pass$(PASS)
+else
+ TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)-cross
+endif
else
TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
endif
-mkdir -v $(DIR_SRC)/binutils-build
cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-configure-1.patch
+ifeq "$(firstword $(MAKEFILE_LIST))" "$(PKG_NAME)"
+ #
+ # Normal build
+ #
+
ifeq "$(PASS)" "1"
+ifeq "$(MACHINE)" "$(MACHINE_REAL)"
cd $(DIR_SRC)/binutils-build && CC="gcc -B/usr/bin/" ../$(THISAPP)/configure \
- --prefix=$(TOOLS_DIR) --disable-nls --disable-werror
+ --prefix=$(TOOLS_DIR) \
+ --disable-nls \
+ --disable-werror
+
cd $(DIR_SRC)/binutils-build && make -j $(PARALLELISM)
cd $(DIR_SRC)/binutils-build && make install
cd $(DIR_SRC)/binutils-build && make -C ld clean
cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=$(TOOLS_DIR)/lib
cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new $(TOOLS_DIR)/bin
+else
+ #
+ # Cross build
+ #
+ cd $(DIR_SRC)/binutils-build && ../$(THISAPP)/configure \
+ --prefix=$(TOOLS_DIR) \
+ --build=${IFS_HOST} \
+ --host=${IFS_TARGET} \
+ --target=${IFS_TARGET} \
+ --disable-nls \
+ --enable-shared \
+ --disable-multilib
+
+ cd $(DIR_SRC)/binutils-build && make configure-host
+ cd $(DIR_SRC)/binutils-build && make -j $(PARALLELISM)
+ cd $(DIR_SRC)/binutils-build && make install
+endif
endif
ifeq "$(PASS)" "2"
- cd $(DIR_SRC)/binutils-build && ../$(THISAPP)/configure --prefix=$(TOOLS_DIR) \
- --disable-nls --with-lib-path=$(TOOLS_DIR)/lib
+ cd $(DIR_SRC)/binutils-build && ../$(THISAPP)/configure \
+ --prefix=$(TOOLS_DIR) \
+ --disable-nls \
+ --with-lib-path=$(TOOLS_DIR)/lib
+
cd $(DIR_SRC)/binutils-build && make -j $(PARALLELISM)
cd $(DIR_SRC)/binutils-build && make install
+
cd $(DIR_SRC)/binutils-build && make -C ld clean
cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/usr/lib:/lib
cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new $(TOOLS_DIR)/bin
cp -fv ../$(THISAPP)/include/libiberty.h /usr/include
endif
+
+else
+ #
+ # Cross build
+ #
+
+ cd $(DIR_SRC)/binutils-build && AR=ar AS=as ../$(THISAPP)/configure \
+ --prefix=$(CTOOLS_DIR) \
+ --host=${IFS_HOST} \
+ --target=${IFS_TARGET} \
+ --with-lib-path=$(TOOLS_DIR)/lib \
+ --disable-nls \
+ --enable-shared \
+ --disable-multilib
+ cd $(DIR_SRC)/binutils-build && make configure-host
+ cd $(DIR_SRC)/binutils-build && make -j $(PARALLELISM)
+ cd $(DIR_SRC)/binutils-build && make install
+ -mkdir -p $(TOOLS_DIR)/include
+ cp -fv $(DIR_APP)/include/libiberty.h $(TOOLS_DIR)/include
+endif
+
@rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build
@$(POSTBUILD)
--- /dev/null
+binutils
\ No newline at end of file
CXXFLAGS =
ifeq "$(STAGE)" "toolchain"
+ifeq "$(firstword $(MAKEFILE_LIST))" "$(PKG_NAME)"
TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)-pass$(PASS)
+else
+ TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)-cross$(PASS)
+endif
else
TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
endif
# Top-level Rules
###############################################################################
-objects = $(DL_FILE)
+objects = $(DL_FILE) \
+ $(THISAPP)-cross_search_paths-1.patch \
+ $(THISAPP)-specs-1.patch
install : $(TARGET)
@$(PREBUILD)
@rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
-mkdir -v $(DIR_SRC)/gcc-build
-
+
+ifeq "$(STAGE)" "toolchain"
+ifeq "$(firstword $(MAKEFILE_LIST))" "$(PKG_NAME)"
+ #
+ # Normal build
+ #
+
ifeq "$(PASS)" "1"
+ifeq "$(MACHINE)" "$(MACHINE_REAL)"
cd $(DIR_SRC)/gcc-build && CC="gcc -B/usr/bin/" ../$(THISAPP)/configure \
- --prefix=$(TOOLS_DIR) --with-local-prefix=/tools --disable-nls \
- --enable-shared --enable-languages=c
+ --prefix=$(TOOLS_DIR) \
+ --with-local-prefix=$(TOOLS_DIR) \
+ --disable-nls \
+ --enable-shared \
+ --enable-languages=c
cd $(DIR_SRC)/gcc-build && make -j $(PARALLELISM)
cd $(DIR_SRC)/gcc-build && make install
ln -vs gcc $(TOOLS_DIR)/bin/cc
+else
+ #
+ # Cross build
+ #
+ cd $(DIR_APP) && sed -e "s,/tools,$(TOOLS_DIR),g" \
+ < $(DIR_PATCHES)/$(THISAPP)-specs-1.patch | patch -Np1
+
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-cross_search_paths-1.patch
+
+ cd $(DIR_APP) && cp -v gcc/cppdefault.c{,.orig}
+ cd $(DIR_APP) && sed -e '/#define STANDARD_INCLUDE_DIR/s@"/usr/include"@0@g' \
+ gcc/cppdefault.c.orig > gcc/cppdefault.c
+
+ cd $(DIR_APP) && cp -v gcc/Makefile.in{,.orig}
+ cd $(DIR_APP) && sed -e 's@\(^NATIVE_SYSTEM_HEADER_DIR =\).*@\1 $(TOOLS_DIR)/include@g' \
+ gcc/Makefile.in.orig > gcc/Makefile.in
+
+ cd $(DIR_SRC)/gcc-build && ../$(THISAPP)/configure \
+ --prefix=$(TOOLS_DIR) \
+ --build=${IFS_HOST} \
+ --host=${IFS_TARGET} \
+ --target=${IFS_TARGET} \
+ --with-local-prefix=$(TOOLS_DIR) \
+ --enable-long-long \
+ --enable-c99 \
+ --enable-shared \
+ --enable-threads=posix \
+ --enable-__cxa_atexit \
+ --disable-nls \
+ --enable-languages=c,c++ \
+ --disable-libstdcxx-pch
+
+ cd $(DIR_SRC)/gcc-build && make -j $(PARALLELISM) AS_FOR_TARGET=$(AS) \
+ LD_FOR_TARGET=$(LD)
+ cd $(DIR_SRC)/gcc-build && make install
+endif
endif
ifeq "$(PASS)" "2"
touch $$file.orig; \
done
- cd $(DIR_SRC)/gcc-build && ../$(THISAPP)/configure --prefix=$(TOOLS_DIR) \
- --with-local-prefix=$(TOOLS_DIR) --enable-clocale=gnu \
- --enable-shared --enable-threads=posix --enable-__cxa_atexit \
- --enable-languages=c,c++ --disable-libstdcxx-pch --disable-bootstrap
+ cd $(DIR_SRC)/gcc-build && ../$(THISAPP)/configure \
+ --prefix=$(TOOLS_DIR) \
+ --with-local-prefix=$(TOOLS_DIR) \
+ --enable-clocale=gnu \
+ --enable-shared \
+ --enable-threads=posix \
+ --enable-__cxa_atexit \
+ --enable-languages=c,c++ \
+ --disable-libstdcxx-pch \
+ --disable-bootstrap
cd $(DIR_SRC)/gcc-build && make -j $(PARALLELISM)
cd $(DIR_SRC)/gcc-build && make install
endif
+else
+ #
+ # Cross build
+ #
+
+ cd $(DIR_APP) && sed -e "s,/tools,$(TOOLS_DIR),g" \
+ < $(DIR_PATCHES)/$(THISAPP)-specs-1.patch | patch -Np1
+
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-cross_search_paths-1.patch
+
+ echo -e "\n#undef STARTFILE_PREFIX_SPEC\n#define STARTFILE_PREFIX_SPEC \"$(TOOLS_DIR)/lib/\"" \
+ >> $(DIR_APP)/gcc/config/linux.h
+
+ cd $(DIR_APP) && cp -v gcc/Makefile.in{,.orig}
+ cd $(DIR_APP) && sed -e "s@\(^CROSS_SYSTEM_HEADER_DIR =\).*@\1 $(TOOLS_DIR)/include@g" \
+ gcc/Makefile.in.orig > gcc/Makefile.in
+
+ifeq "$(PASS)" "1"
+ cd $(DIR_SRC)/gcc-build && ../$(THISAPP)/configure \
+ --prefix=$(CTOOLS_DIR) \
+ --host=${IFS_HOST} \
+ --target=${IFS_TARGET} \
+ --disable-multilib \
+ --with-local-prefix=$(TOOLS_DIR) \
+ --disable-nls \
+ --disable-shared \
+ --disable-threads \
+ --enable-languages=c
+
+ cd $(DIR_SRC)/gcc-build && make all-gcc -j $(PARALLELISM)
+ cd $(DIR_SRC)/gcc-build && make install-gcc
+endif
+
+ifeq "$(PASS)" "2"
+ cd $(DIR_APP) && cp -v configure{,.orig}
+ cd $(DIR_APP) && sed -e '/FLAGS_FOR_TARGET.*\/lib\//s@-B[^ ]*/lib/@@g' configure.orig > \
+ configure
+
+ cd $(DIR_SRC)/gcc-build && ../$(THISAPP)/configure \
+ --prefix=$(CTOOLS_DIR) \
+ --target=${IFS_TARGET} \
+ --host=${IFS_HOST} \
+ --disable-multilib \
+ --with-local-prefix=$(TOOLS_DIR) \
+ --disable-nls \
+ --enable-shared \
+ --enable-languages=c,c++ \
+ --enable-__cxa_atexit \
+ --enable-c99 \
+ --enable-long-long \
+ --enable-threads=posix
+
+ cd $(DIR_SRC)/gcc-build && make AS_FOR_TARGET="${IFS_TARGET}-as" \
+ LD_FOR_TARGET="${IFS_TARGET}-ld"
+ cd $(DIR_SRC)/gcc-build && make install
+endif
+endif
+endif
ifeq "$(STAGE)" "base"
cd $(DIR_APP) && sed -i 's/install_to_$$(INSTALL_DEST) //' libiberty/Makefile.in
cd $(DIR_APP) && sed -i 's/^XCFLAGS =$$/& -fomit-frame-pointer/' gcc/Makefile.in
cd $(DIR_APP) && sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
- cd $(DIR_SRC)/gcc-build && ../$(THISAPP)/configure --prefix=/usr \
- --libexecdir=/usr/lib --enable-shared --enable-threads=posix \
- --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++ \
- --disable-bootstrap
+ cd $(DIR_SRC)/gcc-build && ../$(THISAPP)/configure \
+ --prefix=/usr \
+ --libexecdir=/usr/lib \
+ --enable-shared \
+ --enable-threads=posix \
+ --enable-__cxa_atexit \
+ --enable-clocale=gnu \
+ --enable-languages=c,c++ \
+ --disable-bootstrap
cd $(DIR_SRC)/gcc-build && make -j $(PARALLELISM)
cd $(DIR_SRC)/gcc-build && make install
--- /dev/null
+gcc
\ No newline at end of file
DL_FILE = $(THISAPP).tar.bz2
DIR_APP = $(DIR_SRC)/$(THISAPP)
-CFLAGS = -O2 -mno-tls-direct-seg-refs # This will make it xen-friendly
+CFLAGS =
CXXFLAGS =
-TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
+ifeq "$(firstword $(MAKEFILE_LIST))" "$(PKG_NAME)"
+ TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
+else
+ TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)-cross
+endif
###############################################################################
# Top-level Rules
@rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
@mkdir $(DIR_SRC)/glibc-build
+ifeq "$(firstword $(MAKEFILE_LIST))" "$(PKG_NAME)"
+ #
+ # Normal build
+ #
+
ifeq "$(STAGE)" "toolchain"
cd $(DIR_SRC)/glibc-build && echo "CFLAGS += -march=$(MACHINE)" > configparms
cd $(DIR_SRC)/glibc-build && CFLAGS="$(CFLAGS)" ../$(THISAPP)/configure \
# Timezone
cp -v --remove-destination /usr/share/zoneinfo/GMT /etc/localtime
+endif
+else
+ #
+ # Cross build
+ #
+
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-libgcc_eh-1.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-localedef_segfault-1.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-i586_chk-1.patch
+
+ echo "libc_cv_forced_unwind=yes" > $(DIR_SRC)/glibc-build/config.cache
+ echo "libc_cv_c_cleanup=yes" >> $(DIR_SRC)/glibc-build/config.cache
+
+ cd $(DIR_SRC)/glibc-build && BUILD_CC="gcc" \
+ CC="$(IFS_TARGET)-gcc" \
+ AR="$(IFS_TARGET)-ar" \
+ RANLIB="$(IFS_TARGET)-ranlib" \
+ CFLAGS="-march=$$(cut -d- -f1 <<< $(IFS_TARGET)) -mtune=generic -g -O2" \
+ ../$(THISAPP)/configure \
+ --prefix=$(TOOLS_DIR) \
+ --host=${IFS_TARGET} \
+ --build=$(IFS_HOST) \
+ --disable-profile \
+ --enable-add-ons \
+ --with-tls \
+ --enable-kernel=2.6.0 \
+ --with-__thread \
+ --with-binutils=$(CTOOLS_DIR)/bin \
+ --with-headers=$(TOOLS_DIR)/include \
+ --cache-file=config.cache
+
+ cd $(DIR_SRC)/glibc-build && make PARALLELMFLAGS=-j$(PARALLELISM)
+ cd $(DIR_SRC)/glibc-build && make install
+
endif
@rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build
--- /dev/null
+glibc
\ No newline at end of file
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
ifeq "$(STAGE)" "toolchain"
+ install -dv $(TOOLS_DIR)/include
cd $(DIR_APP) && make mrproper
- cd $(DIR_APP) && make headers_check
- cd $(DIR_APP) && make INSTALL_HDR_PATH=dest headers_install
+ cd $(DIR_APP) && make ARCH=i386 headers_check
+ cd $(DIR_APP) && make ARCH=i386 INSTALL_HDR_PATH=dest headers_install
cd $(DIR_APP) && cp -rv dest/include/* $(TOOLS_DIR)/include
endif
ifeq "$(STAGE)" "base"
cd $(DIR_APP) && make mrproper
- cd $(DIR_APP) && make headers_check
- cd $(DIR_APP) && make INSTALL_HDR_PATH=dest headers_install
+ cd $(DIR_APP) && make ARCH=i386 headers_check
+ cd $(DIR_APP) && make ARCH=i386 INSTALL_HDR_PATH=dest headers_install
cd $(DIR_APP) && cp -rv dest/include/* /usr/include
endif
#
cd $(DIR_APP) && patch -Np1 < $(DIR_PATCHES)/reiser4-for-$(VER).patch
- # ip_conntrack permissions from 440 to 444
- #cd $(DIR_APP) && patch -Np0 < $(DIR_PATCHES)/ip_conntrack_standalone-patch-for-ipfire.patch
-
cd $(DIR_APP) && make mrproper
+
+ -[ "$(TARGET_ARCH)" == "i586" ] && \
+ sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \
+ -e "s/^# CONFIG_MPENTIUMIII is not set/CONFIG_MPENTIUMII=y/" \
+ < $(DIR_CONF)/kernel/kernel.config > $(DIR_APP)/.config
+
+ -[ "$(TARGET_ARCH)" == "i486" ] && \
+ sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \
+ -e "s/^# CONFIG_M486 is not set/CONFIG_M486=y/" \
+ < $(DIR_CONF)/kernel/kernel.config > $(DIR_APP)/.config
+
+ -[ "$(TARGET_ARCH)" == "i386" ] && \
+ sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \
+ -e "s/^# CONFIG_M386 is not set/CONFIG_M386=y/" \
+ < $(DIR_CONF)/kernel/kernel.config > $(DIR_APP)/.config
+
+ -[ "$(TARGET_ARCH)" == "i486" ] && \
+ sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \
+ -e "s/^# CONFIG_M486 is not set/CONFIG_M486=y/" \
+ < $(DIR_CONF)/kernel/kernel.config > $(DIR_APP)/.config
+
+ -[ "$(TARGET_ARCH)" == "via-c7" ] && \
+ sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \
+ -e "s/^# CONFIG_MVIAC7 is not set/CONFIG_MVIAC7=y/" \
+ < $(DIR_CONF)/kernel/kernel.config > $(DIR_APP)/.config
+
+ -[ "$(TARGET_ARCH)" == "via-c3" ] && \
+ sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \
+ -e "s/^# CONFIG_MVIAC3_2 is not set/CONFIG_MVIAC3_2=y/" \
+ < $(DIR_CONF)/kernel/kernel.config > $(DIR_APP)/.config
+
+ # if no $(TARGET) matched use the default
+ [ ! -e "$(DIR_APP)/.config" ] && cp -f $(DIR_CONF)/kernel/kernel.config \
+ $(DIR_APP)/.config
- cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE) $(DIR_APP)/.config
- cd $(DIR_APP) && sed -i -e "s/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(EXTRAVERSION)/" \
- Makefile
+ cd $(DIR_APP) && \
+ sed -i -e "s/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(EXTRAVERSION)/" \
+ Makefile
cd $(DIR_APP) && make oldconfig
# along with IPFire; if not, write to the Free Software #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
# #
-# Copyright (C) 2007 IPFire-Team <info@ipfire.org>. #
+# Copyright (C) 2008 IPFire-Team <info@ipfire.org>. #
# #
############################################################################
#
toolchain_build() {
ORG_PATH=$PATH
- export PATH=$BASEDIR/build_${MACHINE}/usr/local/ccache/bin:$BASEDIR/build_${MACHINE}/usr/local/distcc/bin:$BASEDIR/build_${MACHINE}/$TOOLS_DIR/bin:$PATH
+ export PATH=$BASEDIR/build_${TARGET}/usr/local/ccache/bin:$BASEDIR/build_${TARGET}/usr/local/distcc/bin:$BASEDIR/build_${TARGET}/$CTOOLS_DIR/bin:$BASEDIR/build_${TARGET}/$TOOLS_DIR/bin:$PATH
STAGE_ORDER=01
STAGE=toolchain
LOGFILE="$BASEDIR/log_${MACHINE}/_build.${STAGE_ORDER}-toolchain.log"
export LOGFILE
- NATIVEGCC=`gcc --version | grep GCC | awk {'print $3'}`
- export NATIVEGCC GCCmajor=${NATIVEGCC:0:1} GCCminor=${NATIVEGCC:2:1} GCCrelease=${NATIVEGCC:4:1}
-
# make distcc first so that CCACHE_PREFIX works immediately
[ -z "$DISTCC_HOSTS" ] || toolchain_make distcc
toolchain_make ccache
+ toolchain_make linux
+
+ if [ "${MACHINE}" != "${MACHINE_REAL}" ]; then
+ toolchain_make binutils-x-compile
+ toolchain_make gcc-x-compile PASS=1
+ toolchain_make glibc-x-compile
+ toolchain_make gcc-x-compile PASS=2
+
+ fi
toolchain_make binutils PASS=1
toolchain_make gcc PASS=1
- toolchain_make linux
+ exiterror "Stop here"
+
toolchain_make glibc
toolchain_make adjust-toolchain
- toolchain_make tcl
- toolchain_make expect
- toolchain_make dejagnu
- toolchain_make gcc PASS=2
- toolchain_make binutils PASS=2
+ if [ "${MACHINE}" == "${MACHINE_REAL}" ]; then
+ toolchain_make tcl
+ toolchain_make expect
+ toolchain_make dejagnu
+ toolchain_make gcc PASS=2
+ toolchain_make binutils PASS=2
+ fi
toolchain_make ncurses
toolchain_make bash
toolchain_make bzip2
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
+# 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 #
if [ 'i686' = $MACHINE_REAL \
-o 'i586' = $MACHINE_REAL \
-o 'i486' = $MACHINE_REAL \
- -o 'i386' = $MACHINE_REAL \
-o 'x86_64' = $MACHINE_REAL ]; then
- :
+ IFS_HOST="$(echo $MACHTYPE | sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")"
else
beautify message FAIL
echo "Can't determine your architecture - $MACHINE_REAL"
fi
if [ 'i686' = $TARGET -o 'i586' = $TARGET \
- -o 'i486' = $TARGET -o 'i386' = $TARGET ]; then
+ -o 'i486' = $TARGET ]; then
MACHINE=${TARGET}
MACHINE_REAL=${MACHINE_REAL}
LINKER=/lib/ld-linux.so.2
- C2HOST="${MACHINE}-pc-linux-gnu"
- C2FLAGS="-march=${MACHINE} -O2 -pipe -fomit-frame-pointer"
- CXX2FLAGS="${C2FLAGS}"
+ IFS_TARGET="${MACHINE}-pc-linux-gnu"
+ CFLAGS="-march=${MACHINE} -O2 -pipe -fomit-frame-pointer"
+ CXXFLAGS="${CFLAGS}"
elif [ 'via-c7' = $TARGET ]; then
MACHINE=i686
MACHINE_REAL=${MACHINE_REAL}
LINKER=/lib/ld-linux.so.2
- C2HOST="i686-pc-linux-gnu"
- C2FLAGS="-march=${MACHINE} -mmmx -msse -msse2 -msse3 -O2 -pipe -fomit-frame-pointer"
- CXX2FLAGS="${C2FLAGS}"
+ IFS_TARGET="${MACHINE}-pc-linux-gnu"
+ CFLAGS="-march=${MACHINE} -mmmx -msse -msse2 -msse3 -O2 -pipe -fomit-frame-pointer"
+ CXXFLAGS="${CFLAGS}"
elif [ 'via-c3' = $TARGET ]; then
MACHINE=i586
MACHINE_REAL=${MACHINE_REAL}
LINKER=/lib/ld-linux.so.2
- C2HOST="i586-pc-linux-gnu"
- C2FLAGS="-march=c3 -m3dnow -O2 -pipe -fomit-frame-pointer"
- CXX2FLAGS="${C2FLAGS}"
+ IFS_TARGET="${MACHINE}-pc-linux-gnu"
+ CFLAGS="-march=c3 -m3dnow -O2 -pipe -fomit-frame-pointer"
+ CXXFLAGS="${CFLAGS}"
else
beautify message FAIL
echo "Not a valid target arch (i686|i586|i486|i386|via-c7|via-c3) - $TARGET"
# Set up what used to be /tools
TOOLS_DIR=/tools_${MACHINE}
+CTOOLS_DIR=/cross-tools_${MACHINE}
# Set up /installer
INSTALLER_DIR=/installer
IMAGES_DIR=/images
# include machine in TOOLCHAINNAME
-TOOLCHAINNAME=$SNAME-$TOOLCHAINVERSION-toolchain-${MACHINE}
+TOOLCHAINNAME=$SNAME-$TOOLCHAINVERSION-toolchain-t${TARGET}-m${MACHINE}
###############################################################################
## Measurements for positioning result messages
RESULT_WIDTH=4
TIME_WIDTH=8
-OPT_WIDTH=6
+OPT_WIDTH=7
VER_WIDTH=10
RESULT_COL=$((${COLUMNS} - $RESULT_WIDTH - 4))
TIME_COL=$((${RESULT_COL} - $TIME_WIDTH - 5))
VER_COL=$((${TIME_COL} - $VER_WIDTH - 5))
-OPT_COL=$((${VER_COL} - $OPT_WIDTH - 6))
+OPT_COL=$((${VER_COL} - $OPT_WIDTH - 5))
## Set Cursur Position Commands, used via echo -e
SET_RESULT_COL="\\033[${RESULT_COL}G"
;;
build_stage)
MESSAGE=$2
- echo -ne "${BOLD}*** ${MESSAGE}${SET_OPT_COL} options${SET_VER_COL} version "
+ echo -ne "${BOLD}*** ${MESSAGE}${SET_OPT_COL} options${SET_VER_COL} version "
echo -ne "${SET_TIME_COL} time (sec)${SET_RESULT_COL} status${NORMAL}\n"
;;
make_pkg)
chroot $LFS $TOOLS_DIR/bin/env -i \
HOME=/root \
TERM=$TERM \
- PS1="${BOLD}[chroot-${MACHINE}-${TARGET}]${NORMAL} \u:\w\$ " \
+ PS1="${BOLD}[chroot-${TARGET}(${MACHINE})]${NORMAL} \u:\w\$ " \
PATH=$PATH \
CONFIG_ROOT=${CONFIG_ROOT} \
VERSION=${VERSION} \
INSTALLER_DIR=$INSTALLER_DIR \
MACHINE="$MACHINE" \
MACHINE_REAL="$MACHINE_REAL" \
- CHOST="$C2HOST" \
- CFLAGS="$C2FLAGS" \
- CXXFLAGS="$CXX2FLAGS" \
+ CFLAGS="$CFLAGS" \
+ CXXFLAGS="$CXXFLAGS" \
+ IFS_HOST="$IFS_HOST" \
+ IFS_TARGET="$IFS_TARGET" \
KVER=$KVER \
STAGE=$STAGE \
STAGE_ORDER=$STAGE_ORDER \
CONFIG_ROOT=$CONFIG_ROOT \
LINKER=$LINKER \
TOOLS_DIR=$TOOLS_DIR \
+ CTOOLS_DIR=$CTOOLS_DIR \
MACHINE="$MACHINE" \
+ MACHINE_REAL="$MACHINE_REAL" \
+ IFS_HOST="$IFS_HOST" \
+ IFS_TARGET="$IFS_TARGET" \
LFS_BASEDIR=$BASEDIR \
LFS=$LFS \
PARALLELISM=$PARALLELISM \
IMAGES_DIR=$IMAGES_DIR \
MACHINE="$MACHINE" \
MACHINE_REAL="$MACHINE_REAL" \
- CHOST="$C2HOST" \
- CFLAGS="$C2FLAGS" \
- CXXFLAGS="$CXX2FLAGS" \
+ CFLAGS="$CFLAGS" \
+ CXXFLAGS="$CXXFLAGS" \
+ IFS_HOST="$IFS_HOST" \
+ IFS_TARGET="$IFS_TARGET" \
KVER=$KVER \
STAGE=$STAGE \
STAGE_ORDER=$STAGE_ORDER \
################################################################################
prepareenv() {
- LOGFILE=$BASEDIR/log_${MACHINE}/_build.preparation.log
+ LOGFILE=$BASEDIR/log_${MACHINE}/_build.00-preparation.log
export LOGFILE
mkdir -p $BASEDIR/log_${MACHINE}/01_toolchain 2>/dev/null
- mkdir -p $BASEDIR/log_${MACHINE}/02_base 2>/dev/null
- mkdir -p $BASEDIR/log_${MACHINE}/03_ipfire 2>/dev/null
- mkdir -p $BASEDIR/log_${MACHINE}/04_misc 2>/dev/null
- mkdir -p $BASEDIR/log_${MACHINE}/05_installer 2>/dev/null
- mkdir -p $BASEDIR/log_${MACHINE}/06_packages 2>/dev/null
+ mkdir -p $BASEDIR/log_${MACHINE}/02_base 2>/dev/null
+ mkdir -p $BASEDIR/log_${MACHINE}/03_ipfire 2>/dev/null
+ mkdir -p $BASEDIR/log_${MACHINE}/04_misc 2>/dev/null
+ mkdir -p $BASEDIR/log_${MACHINE}/05_installer 2>/dev/null
+ mkdir -p $BASEDIR/log_${MACHINE}/06_packages 2>/dev/null
#############################################################################
# Are we running the right shell? #
if [ ! -h $TOOLS_DIR ]; then
exiterror "Could not create $TOOLS_DIR symbolic link."
fi
+
+ # Check /ctools symlink
+ if [ -h $CTOOLS_DIR ]; then
+ rm -f $CTOOLS_DIR
+ fi
+ if [ ! -a $CTOOLS_DIR ]; then
+ ln -s $BASEDIR/build_${MACHINE}/$CTOOLS_DIR /
+ fi
+ if [ ! -h $CTOOLS_DIR ]; then
+ exiterror "Could not create $CTOOLS_DIR symbolic link."
+ fi
# Setup environment
set +h
unset CC CXX CPP LD_LIBRARY_PATH LD_PRELOAD
# Make some extra directories
- mkdir -p $BASEDIR/build_${MACHINE}/{$TOOLS_DIR,$INSTALLER_DIR,cdrom,images,usr/local/{ccache,distcc}} 2>/dev/null
+ mkdir -p $BASEDIR/build_${MACHINE}/{$TOOLS_DIR,$CTOOLS_DIR,$INSTALLER_DIR,cdrom,images,usr/local/{ccache,distcc}} 2>/dev/null
mkdir -p $BASEDIR/{cache,ccache,distcc} 2>/dev/null
- mkdir -p $LFS/{$TOOLS_DIR,usr/src} 2>/dev/null
+ mkdir -p $LFS/{$TOOLS_DIR,$CTOOLS_DIR,usr/src} 2>/dev/null
mkdir -p $LFS/dev/pts
mkdir -p $LFS/proc
mkdir -p $LFS/usr/src/{cache,config,doc,lfs,log_${MACHINE},src,ccache,distcc}
mount --bind $BASEDIR/log_${MACHINE} $LFS/usr/src/log_${MACHINE}
mount --bind $BASEDIR/src $LFS/usr/src/src
mount --bind $BASEDIR/build_${MACHINE}/$TOOLS_DIR $LFS/$TOOLS_DIR
+ mount --bind $BASEDIR/build_${MACHINE}/$CTOOLS_DIR $LFS/$CTOOLS_DIR
mount --bind $BASEDIR/build_${MACHINE}/$INSTALLER_DIR $LFS/$INSTALLER_DIR
mount --bind $BASEDIR/build_${MACHINE}/$CDROM_DIR $LFS/$CDROM_DIR
mount --bind $BASEDIR/build_${MACHINE}/$IMAGES_DIR $LFS/$IMAGES_DIR
PACKAGE=`ls -v -r $TOOLCHAINNAME.tar.bz2 2> /dev/null | head -n 1`
#only restore on a clean disk
- echo -ne "Building for ${BOLD}${MACHINE}-${TARGET} on ${MACHINE_REAL}${NORMAL}\n"
+ echo -ne "Building for ${BOLD}${TARGET} (${MACHINE}) on ${MACHINE_REAL}${NORMAL}\n"
if [ -f $BASEDIR/log_${MACHINE}/02_base/stage2-LFS ]; then
prepareenv
beautify message DONE "Stage toolchain already built or extracted"
else
if [ -z "$PACKAGE" ]; then
- echo "Full toolchain compilation" | tee -a $LOGFILE
+ echo "Full toolchain compilation"
prepareenv
. $BASEDIR/tools/make-check
beautify build_stage "Building toolchain"
toolchain_build
else
- echo "Restore from $PACKAGE" | tee -a $LOGFILE
+ echo "Restore from $PACKAGE"
if [ `md5sum $BASEDIR/cache/toolchains/$PACKAGE | awk '{print $1}'` == `cat $BASEDIR/cache/toolchains/$TOOLCHAINNAME.md5 | awk '{print $1}'` ]; then
cd $BASEDIR && tar jxf $BASEDIR/cache/toolchains/$PACKAGE
prepareenv