From b15a589db7dc86ff892caa0577b2db6f3aded9b4 Mon Sep 17 00:00:00 2001 From: Aditya Date: Tue, 10 Jan 2023 15:38:55 +0530 Subject: [PATCH] Add 8.15 - Build tcl --- scripts/chapter8/8.15-tcl.sh | 60 ++++++++++++++++++++++++++++++++++++ scripts/main.sh | 12 ++++++++ 2 files changed, 72 insertions(+) create mode 100644 scripts/chapter8/8.15-tcl.sh diff --git a/scripts/chapter8/8.15-tcl.sh b/scripts/chapter8/8.15-tcl.sh new file mode 100644 index 0000000..0e1c620 --- /dev/null +++ b/scripts/chapter8/8.15-tcl.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +cd /sources +tar xf tcl8.6.12-src.tar.gz +cd tcl8.6.12-src + +tar -xf ../tcl8.6.12-html.tar.gz --strip-components=1 + +SRCDIR=$(pwd) +cd unix +./configure --prefix=/usr \ + --mandir=/usr/share/man + +if [ $? -ne 0 ] +then + exit 1 +fi + +make -j5 + +if [ $? -ne 0 ] +then + exit 1 +fi + +sed -e "s|$SRCDIR/unix|/usr/lib|" \ + -e "s|$SRCDIR|/usr/include|" \ + -i tclConfig.sh + +sed -e "s|$SRCDIR/unix/pkgs/tdbc1.1.3|/usr/lib/tdbc1.1.3|" \ + -e "s|$SRCDIR/pkgs/tdbc1.1.3/generic|/usr/include|" \ + -e "s|$SRCDIR/pkgs/tdbc1.1.3/library|/usr/lib/tcl8.6|" \ + -e "s|$SRCDIR/pkgs/tdbc1.1.3|/usr/include|" \ + -i pkgs/tdbc1.1.3/tdbcConfig.sh + +sed -e "s|$SRCDIR/unix/pkgs/itcl4.2.2|/usr/lib/itcl4.2.2|" \ + -e "s|$SRCDIR/pkgs/itcl4.2.2/generic|/usr/include|" \ + -e "s|$SRCDIR/pkgs/itcl4.2.2|/usr/include|" \ + -i pkgs/itcl4.2.2/itclConfig.sh + +unset SRCDIR + +make test + +make install + +chmod -v u+w /usr/lib/libtcl8.6.so + +make install-private-headers + +ln -sfv tclsh8.6 /usr/bin/tclsh + +mv /usr/share/man/man3/{Thread,Tcl_Thread}.3 + +mkdir -v -p /usr/share/doc/tcl-8.6.12 +cp -v -r ../html/* /usr/share/doc/tcl-8.6.12 + +cd /sources +rm -rf tcl8.6.12-src + diff --git a/scripts/main.sh b/scripts/main.sh index 3b5aaaa..cdbf671 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -714,3 +714,15 @@ then stop_script "chapter8/8.14-flex.sh" fi +# Chapter 8.15 +# ============ +echo "Building tcl" +su -c "bash $SCRIPT/chapter8/8.15-tcl.sh" + +# Exit on error +check_exit_code +if [ $exit_status -ne 0 ] +then + stop_script "chapter8/8.15-tcl.sh" +fi +