From 39d1bc43eebbc73f045a83bdec8ea61201bfbfad Mon Sep 17 00:00:00 2001 From: Aditya Date: Tue, 10 Jan 2023 15:34:10 +0530 Subject: [PATCH] Add 8.14 - Build flex --- scripts/chapter8/8.14-flex.sh | 31 +++++++++++++++++++++++++++++++ scripts/main.sh | 12 ++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 scripts/chapter8/8.14-flex.sh diff --git a/scripts/chapter8/8.14-flex.sh b/scripts/chapter8/8.14-flex.sh new file mode 100644 index 0000000..a6a7526 --- /dev/null +++ b/scripts/chapter8/8.14-flex.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +cd /sources +tar xf flex-2.6.4.tar.gz +flex-2.6.4 + +./configure --prefix=/usr \ + --docdir=/usr/share/doc/flex-2.6.4 \ + --disable-static + +if [ $? -ne 0 ] +then + exit 1 +fi + +make -j5 + +if [ $? -ne 0 ] +then + exit 1 +fi + +make check + +make install + +ln -sv flex /usr/bin/lex + +cd /sources +rm -rf flex-2.6.4 + diff --git a/scripts/main.sh b/scripts/main.sh index 32de21f..3b5aaaa 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -702,3 +702,15 @@ then stop_script "chapter8/8.13-bc.sh" fi +# Chapter 8.14 +# ============ +echo "Building flex" +su -c "bash $SCRIPT/chapter8/8.14-flex.sh" + +# Exit on error +check_exit_code +if [ $exit_status -ne 0 ] +then + stop_script "chapter8/8.14-flex.sh" +fi +