#!/bin/sh # First argument of this script is the package name # Reading system configuration informations, functions and package versions. source ../sysinfos source ../functions source ../packages-list # Applying patches (if any) apply_patches ${1} && # Saves CFLAGS and CXXFLAGS, and clears them. save_flags_no_optimizations # This is necessary so that the compiler is built without # libc includes, which are not yet installed for this target. #export CFLAGS="${CFLAGS} -Dinhibit_libc" #Fortunately, there are configuration options for GCC which tell it not #to build 'libgcc_s.so'. The '--without-headers' option is supposed to #take care of this, but its implementation is incomplete, so you must #also configure with the '--with-newlib' option. While '--with-newlib' #appears to mean "Use the Newlib C library", its effect is to tell the #GCC build machinery, "Don't assume there is a C library available." #We also need to disable some of the libraries that would normally be #built along with GCC, and specify that only the compiler for the C #language is needed. cd ${LFS_TMP}/${1}-build && ../${1}/configure \ --target=${TARGET} \ --prefix=${PREFIX} \ --with-sysroot=${SYSROOT} \ --without-headers --with-newlib \ --disable-shared \ --disable-threads \ --disable-libssp \ --disable-libgomp \ --disable-libmudflap \ --enable-languages=c && make all-gcc && make install-gcc exit $?