8.4. Tcl-8.6.10

The Tcl package contains the Tool Command Language, a robust general-purpose scripting language. The Expect package is written in the Tcl language.

Approximate build time: 4.0 SBU
Required disk space: 83 MB

8.4.1. Installation of Tcl

This package and the next two (Expect and DejaGNU) are installed to support running the test suites for GCC and binutils 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. These packages are required to run the test suites in this chapter.

First, unpack the documentation by issuing the following command:

tar -xf ../tcl8.6.10-html.tar.gz --strip-components=1

Prepare Tcl for compilation:

SRCDIR=$(pwd)
cd unix
./configure --prefix=/usr           \
            --mandir=/usr/share/man \
            $([ "$(uname -m)" = x86_64 ] && echo --enable-64bit)

The meaning of the configure options:

$([ "$(uname -m)" = x86_64 ] && echo --enable-64bit)

The construct $(<shell command>) is replaced by the output of the shell command. Here this output is empty if running on a 32 bit machine, and is --enable-64bit if running on a 64 bit machine.

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.1|/usr/lib/tdbc1.1.1|" \
    -e "s|$SRCDIR/pkgs/tdbc1.1.1/generic|/usr/include|"    \
    -e "s|$SRCDIR/pkgs/tdbc1.1.1/library|/usr/lib/tcl8.6|" \
    -e "s|$SRCDIR/pkgs/tdbc1.1.1|/usr/include|"            \
    -i pkgs/tdbc1.1.1/tdbcConfig.sh

sed -e "s|$SRCDIR/unix/pkgs/itcl4.2.0|/usr/lib/itcl4.2.0|" \
    -e "s|$SRCDIR/pkgs/itcl4.2.0/generic|/usr/include|"    \
    -e "s|$SRCDIR/pkgs/itcl4.2.0|/usr/include|"            \
    -i pkgs/itcl4.2.0/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
[Note]

Note

In the test results there are several places associated with clock.test that indicate a failure, but the summary at the end indicates no failures. clock.test passes on a complete LFS system.

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

Finally, rename a man page that conflicts with a Perl man page:

mv /usr/share/man/man3/{Thread,Tcl_Thread}.3

8.4.2. Contents of Tcl

Installed programs: tclsh (link to tclsh8.6) and tclsh8.6
Installed library: libtcl8.6.so and libtclstub8.6.a

Short Descriptions

tclsh8.6

The Tcl command shell

tclsh

A link to tclsh8.6

libtcl8.6.so

The Tcl library

libtclstub8.6.a

The Tcl Stub library