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 +