The Tcl package contains the Tool Command Language, a robust general-purpose scripting language. The Expect package is written in the Tcl language.
This package and the next two (Expect and DejaGNU) are installed to support running the test suites for binutils and GCC and other packages. Installing three packages for testing purposes may seem excessive, but it is very reassuring, if not essential, to know that the most important tools are working properly.
First, unpack the documentation by issuing the following command:
tar -xf ../tcl8.6.12-html.tar.gz --strip-components=1
Prepare Tcl for compilation:
SRCDIR=$(pwd) cd unix ./configure --prefix=/usr \ --mandir=/usr/share/man
Build the package:
make 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
The various “sed” instructions after the “make” command removes references to the build directory from the configuration files and replaces them with the install directory. This is not mandatory for the remainder of LFS, but may be needed in case a package built later uses Tcl.
To test the results, issue:
make test
Install the package:
make install
Make the installed library writable so debugging symbols can be removed later:
chmod -v u+w /usr/lib/libtcl8.6.so
Install Tcl's headers. The next package, Expect, requires them.
make install-private-headers
Now make a necessary symbolic link:
ln -sfv tclsh8.6 /usr/bin/tclsh
Rename a man page that conflicts with a Perl man page:
mv /usr/share/man/man3/{Thread,Tcl_Thread}.3
If you downloaded the optional documentation, install it by issuing the following commands:
mkdir -v -p /usr/share/doc/tcl-8.6.12 cp -v -r ../html/* /usr/share/doc/tcl-8.6.12