#!/bin/sh set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos source ../functions source ../packages-list # Manually applying patches apply_patch ${1}-branch_update-1.patch ${1} case "${HVL_TARGET}" in "x86") apply_patch ${1}-specs-1.patch ${1} ;; "x86_64") apply_patch ${1}-pure64_specs-1.patch ${1} ;; esac cd ${LFS_TMP}/${1} # 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 # Set the directory searched by the fixincludes process for system headers, so it won't look at the host's headers: cp -v gcc/Makefile.in{,.orig} sed -e 's@\(^NATIVE_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g' \ gcc/Makefile.in.orig > gcc/Makefile.in # --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. # --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. # --enable-languages=c # This option ensures that only the C compiler is built. cd ${LFS_TMP}/${1}-build CC="${CC} ${CLFS_BUILDFLAGS}" CXX="${CXX} ${CLFS_BUILDFLAGS}" \ ../${1}/configure \ --prefix=/tools \ --build=${CLFS_HOST} \ --host=${CLFS_TARGET} \ --target=${CLFS_TARGET} \ --disable-multilib \ --with-local-prefix=/tools \ --libexecdir=/tools/lib \ --disable-nls \ --disable-libstdcxx-pch \ --enable-long-long \ --enable-c99 \ --enable-shared \ --enable-threads=posix \ --enable-__cxa_atexit \ --enable-languages=c,c++ # Prevent GCC from looking in the wrong directories for headers and libraries: cp Makefile{,.orig} sed "/^HOST_\(GMP\|PPL\|CLOOG\)\(LIBS\|INC\)/s:-[IL]/\(lib\|include\)::" \ Makefile.orig > Makefile ${HVMAKE} AS_FOR_TARGET="${AS}" LD_FOR_TARGET="${LD}" ${HVMAKE} install exit $?