From d61631a9df299496224c739b569facd957ea5322 Mon Sep 17 00:00:00 2001 From: Aditya Date: Mon, 9 Jan 2023 10:47:03 +0530 Subject: [PATCH] Add 6.2 - Build m4 --- scripts/chapter6/6.2-m4.sh | 27 +++++++++++++++++++++++++++ scripts/main.sh | 16 +++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 scripts/chapter6/6.2-m4.sh diff --git a/scripts/chapter6/6.2-m4.sh b/scripts/chapter6/6.2-m4.sh new file mode 100644 index 0000000..6a1a316 --- /dev/null +++ b/scripts/chapter6/6.2-m4.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +cd $LFS/sources +tar xf m4-1.4.19.tar.xz +cd m4-1.4.19 + +./configure --prefix=/usr \ + --host=$LFS_TGT \ + --build=$(build-aux/config.guess) + +if [ $? -ne 0 ] +then + exit 1 +fi + +make -j5 + +if [ $? -ne 0 ] +then + exit 1 +fi + +make DESTDIR=$LFS install + +cd $LFS/sources +rm -rf m4-1.4.19 + diff --git a/scripts/main.sh b/scripts/main.sh index 1a8910f..b05fca3 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -131,6 +131,7 @@ fi # Chapter 5.2 # =========== +echo "Chapter 5" echo "Building binutils" su - lfs -c "bash $PWD/chapter5/5.2-binutils.sh" @@ -180,7 +181,7 @@ fi # Chapter 5.6 # =========== echo "Building listdc++" -su - lfs -c "$PWD/chapter5/5.6-libstdc++.sh" +su - lfs -c "bash $PWD/chapter5/5.6-libstdc++.sh" # Exit on error check_exit_code @@ -189,3 +190,16 @@ then stop_script "chapter5/5.6-libstdc++.sh" fi +# Chapter 6.2 +# =========== +echo "Chapter 6" +echo "Building m4" +su - lfs -c "bash $PWD/chapter6/6.2-m4.sh" + +# Exit on error +check_exit_code +if [ $exit_status -ne 0 ] +then + stop_script "chapter6/6/2-m4.sh" +fi +