From d5d0e81da1ed7b7ca9c279bc7946446906cbee33 Mon Sep 17 00:00:00 2001 From: Aditya Date: Fri, 6 Jan 2023 14:43:50 +0530 Subject: [PATCH] Add 5.2 - build binutils --- scripts/chapter5/5.2-binutils.sh | 26 ++++++++++++++++++++++++++ scripts/main.sh | 15 ++++++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 scripts/chapter5/5.2-binutils.sh diff --git a/scripts/chapter5/5.2-binutils.sh b/scripts/chapter5/5.2-binutils.sh new file mode 100644 index 0000000..5824e22 --- /dev/null +++ b/scripts/chapter5/5.2-binutils.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +mkdir -v build +cd build + +../configure --prefix=$LFS/tools \ + --with-sysroot=$LFS \ + --target=$LFS_TGT \ + --disable-nls \ + --enable-gprofng=no \ + --disable-werror + +if [ $? -ne 0 ] +then + exit 1 +fi + +make -j5 + +if [ $? -ne 0 ] +then + exit 1 +fi + +make install + diff --git a/scripts/main.sh b/scripts/main.sh index c3a7d7c..7a56c63 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -121,10 +121,23 @@ PWD=$(pwd) echo "Setting Up the Environment" su - lfs -c "$PWD/chapter4/4.4-set-up-env.sh" - # Exit on error check_exit_code if [ $exit_status -ne 0 ] then stop_script "chapter4/4.4-set-up-env.sh" fi + +# Chapter 5.2 +# =========== +echo "Building binutils" +su - lfs -c "$PWD/chapter5/5.2-binutils.sh" + +# Exit on error +check_exit_code +if [ $exit_status -ne 0 ] +then + stop_script "chapter5/5.2-binutils.sh" +fi + +