aboutsummaryrefslogtreecommitdiffstats
path: root/chapter5/gcc.sh
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2021-03-18 11:16:49 -0500
committerWilliam Harrington <kb0iic@berzerkula.org>2021-03-18 11:16:49 -0500
commitbbf8c8d4222a70ea1228f0ec974c6e2f0510f5b2 (patch)
treed0c8e04aeee32b4a003f8f5279caa99de221510c /chapter5/gcc.sh
parent5a0d563dfe209f2be5d2555fccd4613accbc1249 (diff)
Add Chapter 5 build scripts for binutils, gcc, glibc, libstdc++ and linux-api-headers.
Diffstat (limited to 'chapter5/gcc.sh')
-rw-r--r--chapter5/gcc.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/chapter5/gcc.sh b/chapter5/gcc.sh
new file mode 100644
index 0000000..c5404d1
--- /dev/null
+++ b/chapter5/gcc.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+mkdir -p mpfr gmp mpc
+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
+
+../configure \
+ --target=${LFS_TGT} \
+ --prefix=${LFS}/tools \
+ --with-glibc-version=2.11 \
+ --with-sysroot=${LFS} \
+ --with-newlib \
+ --without-headers \
+ --enable-initfini-array \
+ --disable-nls \
+ --disable-shared \
+ --disable-multilib \
+ --disable-decimal-float \
+ --disable-threads \
+ --disable-libatomic \
+ --disable-libgomp \
+ --disable-libquadmath \
+ --disable-libssp \
+ --disable-libvtv \
+ --disable-libstdcxx \
+ --enable-languages=c,c++ &&
+
+make &&
+make -j1 install &&
+
+cd ..
+cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \
+ `dirname $(${LFS_TGT}-gcc -print-libgcc-file-name)`/install-tools/include/limits.h \ No newline at end of file