diff options
Diffstat (limited to 'chapter6/gcc.sh')
-rw-r--r-- | chapter6/gcc.sh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/chapter6/gcc.sh b/chapter6/gcc.sh new file mode 100644 index 0000000..d13ef9f --- /dev/null +++ b/chapter6/gcc.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +mkdir -p isl mpfr gmp mpc +tar -xf ../isl-*.tar.xz -C isl --strip-components=1 +tar -xf ../mpfr-*.tar.xz -C mpfr --strip-components=1 +tar -xf ../gmp-*.tar.xz -C gmp --strip-components=1 +tar -xf ../mpc-*.tar.gz -C mpc --strip-components=1 + +case $(uname -m) in + x86_64) + sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64 + ;; +esac + +mkdir -v build +cd build + +mkdir -pv ${LFS_TGT}/libgcc && +ln -s ../../../libgcc/gthr-posix.h ${LFS_TGT}/libgcc/gthr-default.h && +../configure \ + --build=$(../config.guess) \ + --host=${LFS_TGT} \ + --prefix=/usr \ + CC_FOR_TARGET=${LFS_TGT}-gcc \ + --with-build-sysroot=${LFS} \ + --enable-initfini-array \ + --disable-nls \ + --disable-multilib \ + --disable-decimal-float \ + --disable-libatomic \ + --disable-libgomp \ + --disable-libquadmath \ + --disable-libssp \ + --disable-libvtv \ + --disable-libstdcxx \ + --enable-languages=c,c++ && +make && +make DESTDIR=${LFS} -j1 install && +ln -sv gcc ${LFS}/usr/bin/cc |