-#!/bin/sh
+#!/bin/bash
set -o errexit
# Reading system configuration informations, functions and package versions.
# Manually applying patches
apply_patch ${1}-branch_update-1.patch ${1}
+case "${HVL_TARGET}" in
+ "x86*")
+ TARGET_CONFIGURE_OPTS="--with-ppl=/cross-tools \
+ --with-cloog=/cross-tools \
+ --with-local-prefix=/tools \
+ --disable-multilib"
+ ;;
+esac
+
case "${HVL_TARGET}" in
"x86")
apply_patch ${1}-specs-1.patch ${1}
touch /tools/include/limits.h
# --with-local-prefix=/tools
-# The purpose of this switch is to remove /usr/local/include from gcc's include search path.
-# This is not absolutely essential, however, it helps to minimize the influence of the host system.
+# Remove /usr/local/include from gcc's include search path. This is not
+# absolutely essential, however, it helps to minimize the influence of the
+# host system.
# --disable-shared
# Disables the creation of the shared libraries.
# --disable-threads
-# This will prevent GCC from looking for the multi-thread include files, since they haven't been
-# created for this architecture yet. GCC will be able to find the multi-thread information after
-# the Glibc headers are created.
+# Prevents GCC from looking for the multi-thread include files, since they
+# haven't been created for this architecture yet. GCC will be able to find
+# the multi-thread information after the libc headers are created.
# --enable-languages=c
# This option ensures that only the C compiler is built.
cd ${LFS_TMP}/${1}-build
--host=${CLFS_HOST} \
--target=${CLFS_TARGET} \
--with-sysroot=${CLFS} \
- --with-local-prefix=/tools \
--disable-nls \
--disable-shared \
--with-mpfr=/cross-tools \
--with-gmp=/cross-tools \
- --with-ppl=/cross-tools \
- --with-cloog=/cross-tools \
--without-headers \
--with-newlib \
--disable-decimal-float \
--disable-libssp \
--disable-threads \
--enable-languages=c \
- --disable-multilib
+ ${TARGET_CONFIGURE_OPTS}
${HVMAKE} all-gcc all-target-libgcc
${HVMAKE} install-gcc install-target-libgcc
+case "${HVL_TARGET}" in
+ arm*)
+ # Workaround for uClibc
+ echo "#include \"/cross-tools/lib/gcc/arm926t-unknown-linux-gnueabi/4.4.2/include-fixed/limits.h\"" > /tools/include/limits.h
+ ;;
+esac
+
exit $?