From 8313733a62226d949528d7dc37fb92a3a681d8c0 Mon Sep 17 00:00:00 2001 From: Aditya Date: Thu, 12 Jan 2023 14:22:47 +0530 Subject: [PATCH] Add 8.48 - Build libelf --- scripts/chapter8/8.48-libelf.sh | 30 ++++++++++++++++++++++++++++++ scripts/main.sh | 12 ++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 scripts/chapter8/8.48-libelf.sh diff --git a/scripts/chapter8/8.48-libelf.sh b/scripts/chapter8/8.48-libelf.sh new file mode 100644 index 0000000..e0557c8 --- /dev/null +++ b/scripts/chapter8/8.48-libelf.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +cd /sources +tar xf elfutils-0.187.tar.bz2 +cd elfutils-0.187 + +./configure --prefix=/usr \ + --disable-debuginfod \ + --enable-libdebuginfod=dummy + +if [ $? -ne 0 ] +then + exit 1 +fi + +make -j5 + +if [ $? -ne 0 ] +then + exit 1 +fi + +make check + +make -C libelf install +install -vm644 config/libelf.pc /usr/lib/pkgconfig +rm /usr/lib/libelf.a + +cd /sources +rm -rf elfutils-0.187 diff --git a/scripts/main.sh b/scripts/main.sh index 6fd40bc..0af1c20 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -1115,3 +1115,15 @@ then stop_script "chapter8/8.47-kmod.sh" fi +# Chapter 8.48 +# ============ +echo "Building libelf" +su -c "bash $SCRIPT/chapter8/8.48-libelf.sh" + +# Exit on error +check_exit_code +if [ $exit_status -ne 0 ] +then + stop_script "chapter8/8.48-libelf.sh" +fi +