#!/bin/bash hvconfig_pre() { export AR=ar export LDFLAGS="-Wl,-rpath,/cross-tools/lib" # Common options for passes 1 & 2 CONFIGURE_OPTS+=" \ --build=${CLFS_HOST} \ --host=${CLFS_HOST} \ --target=${CLFS_TARGET} \ --with-sysroot=${CLFS} \ --with-local-prefix=/tools \ --disable-nls \ --with-mpfr=/cross-tools \ --with-gmp=/cross-tools \ --with-ppl=/cross-tools \ --with-cloog=/cross-tools \ --enable-cloog-backend=isl \ --disable-multilib" if [ "x${HVLABEL}" = "x${GCC}-pass1" ]; then CONFIGURE_OPTS+=" \ --disable-shared \ --without-headers \ --with-newlib \ --disable-decimal-float \ --disable-libgomp \ --disable-libmudflap \ --disable-libssp \ --disable-threads \ --enable-languages=c" else CONFIGURE_OPTS+=" \ --enable-shared \ --enable-languages=c,c++ \ --enable-__cxa_atexit \ --enable-c99 \ --enable-long-long \ --enable-threads=posix" fi cd ${LFS_TMP}/${PACKAGE} # Change the StartFile Spec to point to the correct library location: echo -en '#undef STANDARD_INCLUDE_DIR\n#define STANDARD_INCLUDE_DIR "/tools/include/"\n\n' >> gcc/config/linux.h echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"\n' >> gcc/config/linux.h echo -en '\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 ""\n' >> gcc/config/linux.h # Alter gcc's C preprocessor's default include search path to use /tools # only: sed -e "s@\(^CROSS_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g" \ -i gcc/Makefile.in if [ "x${HVLABEL}" = "x${GCC}-pass1" ]; then # We will create a dummy limits.h so the build will not use the one # provided by the host distro: touch /tools/include/limits.h fi } hvconfig_post() { unset AR unset LDFLAGS } hvbuild() { if [ "x${HVLABEL}" = "x${GCC}-pass1" ]; then ${HVMAKE} all-gcc all-target-libgcc ${HVMAKE} install-gcc install-target-libgcc else ${HVMAKE} \ AS_FOR_TARGET="${CLFS_TARGET}-as" \ LD_FOR_TARGET="${CLFS_TARGET}-ld" ${HVMAKE} install fi }