<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../../general.ent">
  %general-entities;

  <!ENTITY tcl-download-http "&sourceforge-repo;/tcl/tcl&tcl-version;-src.tar.gz">
  <!ENTITY tcl-download-ftp  " ">
  <!ENTITY tcl-md5sum        "db382feca91754b7f93da16dc4cdad1f">
  <!ENTITY tcl-size          "8.5 MB">
  <!ENTITY tcl-buildsize     "73 MB (includes documentation installation)(add 10MB for tests)">
  <!ENTITY tcl-time          "0.9 SBU (adittional 2.2 SBU for the tests)">

  <!ENTITY tcl-doc-download  "&sourceforge-repo;/tcl/tcl&tcl-version;-html.tar.gz">
  <!ENTITY tcl-doc-md5sum    "912142f117a090e83e8ec3d771572191">
  <!ENTITY tcl-doc-size      "1.2 MB">

  <!-- Ensure this is updated when Tcl moves from the 8.6.x branch -->
  <!ENTITY tcl-ver           "8.6">
]>

<sect1 id="tcl" xreflabel="Tcl-&tcl-version;">
  <?dbhtml filename="tcl.html"?>

  <sect1info>
    <othername>$LastChangedBy: bdubbs $</othername>
    <date>$Date: 2015-02-20 16:15:05 -0500 (Fri, 20 Feb 2015) $</date>
  </sect1info>

  <title>Tcl-&tcl-version;</title>

  <indexterm zone="tcl">
    <primary sortas="a-Tcl">Tcl</primary>
  </indexterm>

  <sect2 role="package">
    <title>Introduction to Tcl</title>

    <para>
      The <application>Tcl</application> package contains the Tool Command
      Language, a robust general-purpose scripting language.
    </para>

    &lfs77_checked;

    <bridgehead renderas="sect3">Package Information</bridgehead>
    <itemizedlist spacing="compact">
      <listitem>
        <para>
          Download (HTTP): <ulink url="&tcl-download-http;"/>
        </para>
      </listitem>
      <listitem>
        <para>
          Download (FTP): <ulink url="&tcl-download-ftp;"/>
        </para>
      </listitem>
      <listitem>
        <para>
          Download MD5 sum: &tcl-md5sum;
        </para>
      </listitem>
      <listitem>
        <para>
          Download size: &tcl-size;
        </para>
      </listitem>
      <listitem>
        <para>
          Estimated disk space required: &tcl-buildsize;
        </para>
      </listitem>
      <listitem>
        <para>
          Estimated build time: &tcl-time;
        </para>
      </listitem>
    </itemizedlist>

   <bridgehead renderas="sect3">Additional Downloads</bridgehead>
    <itemizedlist spacing="compact">
      <title>Optional Documentation</title>
      <listitem>
        <para>
          Download (HTTP): <ulink url="&tcl-doc-download;"/>
        </para>
      </listitem>
      <listitem>
        <para>
          Download MD5 sum: &tcl-doc-md5sum;
        </para>
      </listitem>
      <listitem>
        <para>
          Download size: &tcl-doc-size;
        </para>
      </listitem>
    </itemizedlist>

    <para condition="html" role="usernotes">User Notes:
      <ulink url="&blfs-wiki;/tcl"/>
    </para>
  </sect2>

  <sect2 role="installation">
    <title>Installation of Tcl</title>

    <para>
      This package is also installed in LFS during the bootstrap phase.
      As it is not installed during Chapter 6 of LFS, installation instructions
      are included here in BLFS.
    </para>

    <para>
      If you downloaded the optional documentation, unpack the tarball
      by issuing the following command:
    </para>

<screen><userinput>tar -xf ../tcl&tcl-version;-html.tar.gz --strip-components=1</userinput></screen>

  </sect2>
  
  <sect2 role="installation">
    <title>32-bit Installation</title>

    <para>
      Install <application>Tcl</application> by running the following
      commands:
    </para>

<screen><userinput>export SRCDIR=`pwd` &amp;&amp;

cd unix &amp;&amp;

BUILDENV=32 ./configure --prefix=/usr \
            --without-tzdata        \
            --mandir=/usr/share/man \
            --libdir=/usr/lib32     \
            CC="gcc -m32" &amp;&amp;
make &amp;&amp;

sed -e "s#$SRCDIR/unix#/usr/lib32#" \
    -e "s#$SRCDIR#/usr/include#"  \
    -i tclConfig.sh               &amp;&amp;

sed -e "s#$SRCDIR/unix/pkgs/tdbc1.0.2#/usr/lib32/tdbc1.0.2#" \
    -e "s#$SRCDIR/pkgs/tdbc1.0.2/generic#/usr/include#"    \
    -e "s#$SRCDIR/pkgs/tdbc1.0.2/library#/usr/lib32/tcl8.6#" \
    -e "s#$SRCDIR/pkgs/tdbc1.0.2#/usr/include#"            \
    -i pkgs/tdbc1.0.2/tdbcConfig.sh                        &amp;&amp;

sed -e "s#$SRCDIR/unix/pkgs/itcl4.0.2#/usr/lib32/itcl4.0.2#" \
    -e "s#$SRCDIR/pkgs/itcl4.0.2/generic#/usr/include#"    \
    -e "s#$SRCDIR/pkgs/itcl4.0.2#/usr/include#"            \
    -i pkgs/itcl4.0.2/itclConfig.sh                        &amp;&amp;

unset SRCDIR</userinput></screen>


    <para>
      To test the results, issue: <command>make test</command>.
    </para>

    <para>
      Now, as the <systemitem class="username">root</systemitem> user:
    </para>

<screen role="root"><userinput>make install &amp;&amp;
make install-private-headers &amp;&amp;
mv -v /usr/bin/tclsh&tcl-ver;{,-32}
ln -v -sf tclsh&tcl-ver;-32 /usr/bin/tclsh-32 &amp;&amp;
chmod -v 755 /usr/lib32/libtcl&tcl-ver;.so</userinput></screen>

    <para>Clean up the build directory before moving on to the next platform:</para>
<screen><userinput remap="install">make clean
cd ..</userinput></screen>

  </sect2>

  <sect2 role="installation">
    <title>x32 ABI Installation</title>

    <para>
      Install <application>Tcl</application> by running the following
      commands:
    </para>

<screen><userinput>export SRCDIR=`pwd` &amp;&amp;

cd unix &amp;&amp;

BUILDENV=x32 ./configure --prefix=/usr \
            --without-tzdata        \
            --mandir=/usr/share/man \
            --libdir=/usr/libx32    \
            CC="gcc -mx32" &amp;&amp;
make &amp;&amp;

sed -e "s#$SRCDIR/unix#/usr/libx32#" \
    -e "s#$SRCDIR#/usr/include#"  \
    -i tclConfig.sh               &amp;&amp;

sed -e "s#$SRCDIR/unix/pkgs/tdbc1.0.2#/usr/libx32/tdbc1.0.2#" \
    -e "s#$SRCDIR/pkgs/tdbc1.0.2/generic#/usr/include#"    \
    -e "s#$SRCDIR/pkgs/tdbc1.0.2/library#/usr/libx32/tcl8.6#" \
    -e "s#$SRCDIR/pkgs/tdbc1.0.2#/usr/include#"            \
    -i pkgs/tdbc1.0.2/tdbcConfig.sh                        &amp;&amp;

sed -e "s#$SRCDIR/unix/pkgs/itcl4.0.2#/usr/libx32/itcl4.0.2#" \
    -e "s#$SRCDIR/pkgs/itcl4.0.2/generic#/usr/include#"    \
    -e "s#$SRCDIR/pkgs/itcl4.0.2#/usr/include#"            \
    -i pkgs/itcl4.0.2/itclConfig.sh                        &amp;&amp;

unset SRCDIR</userinput></screen>


    <para>
      To test the results, issue: <command>make test</command>.
    </para>

    <para>
      Now, as the <systemitem class="username">root</systemitem> user:
    </para>

<screen role="root"><userinput>make install &amp;&amp;
make install-private-headers &amp;&amp;
mv -v /usr/bin/tclsh&tcl-ver;{,-x32}
ln -v -sf tclsh&tcl-ver;-x32 /usr/bin/tclsh-x32 &amp;&amp;
chmod -v 755 /usr/libx32/libtcl&tcl-ver;.so</userinput></screen>

    <para>Clean up the build directory before moving on to the next platform:</para>
<screen><userinput remap="install">make clean
cd ..</userinput></screen>

  </sect2>

  <sect2 role="installation">
    <title>64-bit Installation</title>

    <para>
      Install <application>Tcl</application> by running the following
      commands:
    </para>

<screen><userinput>export SRCDIR=`pwd` &amp;&amp;

cd unix &amp;&amp;

./configure --prefix=/usr           \
            --without-tzdata        \
            --mandir=/usr/share/man \
            $([ $(uname -m) = x86_64 ] &amp;&amp; echo --enable-64bit) &amp;&amp;
make &amp;&amp;

sed -e "s#$SRCDIR/unix#/usr/lib#" \
    -e "s#$SRCDIR#/usr/include#"  \
    -i tclConfig.sh               &amp;&amp;

sed -e "s#$SRCDIR/unix/pkgs/tdbc1.0.2#/usr/lib/tdbc1.0.2#" \
    -e "s#$SRCDIR/pkgs/tdbc1.0.2/generic#/usr/include#"    \
    -e "s#$SRCDIR/pkgs/tdbc1.0.2/library#/usr/lib/tcl8.6#" \
    -e "s#$SRCDIR/pkgs/tdbc1.0.2#/usr/include#"            \
    -i pkgs/tdbc1.0.2/tdbcConfig.sh                        &amp;&amp;

sed -e "s#$SRCDIR/unix/pkgs/itcl4.0.2#/usr/lib/itcl4.0.2#" \
    -e "s#$SRCDIR/pkgs/itcl4.0.2/generic#/usr/include#"    \
    -e "s#$SRCDIR/pkgs/itcl4.0.2#/usr/include#"            \
    -i pkgs/itcl4.0.2/itclConfig.sh                        &amp;&amp;

unset SRCDIR</userinput></screen>


    <para>
      To test the results, issue: <command>make test</command>.
    </para>

    <para>
      Now, as the <systemitem class="username">root</systemitem> user:
    </para>

<screen role="root"><userinput>make install &amp;&amp;
make install-private-headers &amp;&amp;
mv -v /usr/bin/tclsh&tcl-ver;{,-64}
ln -v -sf tclsh&tcl-ver;-64 /usr/bin/tclsh-64 &amp;&amp;
ln -sfv multiarch_wrapper /usr/bin/tclsh
ln -sfv multiarch_wrapper /usr/bin/tclsh&tcl-ver;
chmod -v 755 /usr/lib/libtcl&tcl-ver;.so</userinput></screen>

    <para>
      If you downloaded the optional documentation, install it by issuing
      the following commands as the
      <systemitem class="username">root</systemitem> user:
    </para>

<screen role="root"><userinput>mkdir -v -p /usr/share/doc/tcl-&tcl-version; &amp;&amp;
cp -v -r  ../html/* /usr/share/doc/tcl-&tcl-version;</userinput></screen>

  </sect2>

  <sect2 role="commands">
    <title>Command Explanations</title>

    <para>
      <option>--without-tzdata</option>: This switch prevents installation
      of the shipped timezone data which are older than the ones provided
      in LFS.
    </para>

    <para>
      <parameter>$([ $(uname -m) = x86_64 ] &amp;&amp; echo
      --enable-64bit)</parameter>: This switch is used to enable 64 bit
      support in <application>Tcl</application> on 64 bit operating
      systems.
    </para>

    <para>
      <command>make install-private-headers</command>: This command is
      used to install the <application>Tcl</application> library interface
      headers used by other packages if they link to the
      <application>Tcl</application> library.
    </para>

    <para>
      <command>ln -v -sf tclsh&tcl-ver; /usr/bin/tclsh</command>: This
      command is used to create a compatibility symbolic link to the
      <command>tclsh&tcl-ver;</command> file as many packages expect a file
      named <command>tclsh</command>.
    </para>

    <para>
      <command>sed -e ...</command>: The <application>Tcl</application> package
      expects that its source tree is preserved so that packages depending on
      it for their compilation can utilize it. These <command>sed</command>
      remove the references to the build directory and replace them with saner
      system-wide locations.
    </para>

  </sect2>

  <sect2 role="content">
    <title>Contents</title>

    <segmentedlist>
      <segtitle>Installed Programs</segtitle>
      <segtitle>Installed Libraries</segtitle>
      <segtitle>Installed Directories</segtitle>

      <seglistitem>
        <seg>
          tclsh and tclsh&tcl-ver;
        </seg>
        <seg>
          libtcl&tcl-ver;.so and libtclstub&tcl-ver;.a
        </seg>
        <seg>
          /usr/lib/itcl4.0.1,
          /usr/lib/sqlite3.8.6
          /usr/lib/tcl8,
          /usr/lib/tcl&tcl-ver;,
          /usr/lib/tdbc1.0.1,
          /usr/lib/tdbcmysql1.0.1,
          /usr/lib/tdbcodbc1.0.1,
          /usr/lib/tdbcpostgres1.0.1,
          /usr/lib/thread2.7.1,
          /usr/share/doc/tcl-&tcl-version;, and
          /usr/share/man/mann
        </seg>
      </seglistitem>
    </segmentedlist>

    <variablelist>
      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="tclsh">
        <term><command>tclsh</command></term>
        <listitem>
          <para>
            is a symlink to the <command>tclsh&tcl-ver;</command> program.
          </para>
          <indexterm zone="tcl tclsh">
            <primary sortas="b-tclsh">tclsh</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="tclsh-eight">
        <term><command>tclsh&tcl-ver;</command></term>
        <listitem>
          <para>
            is a simple shell containing the
            <application>Tcl</application> interpreter.
          </para>
          <indexterm zone="tcl tclsh-eight">
            <primary sortas="b-tclsh&tcl-ver;">tclsh&tcl-ver;</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="libtcl">
        <term><filename class="libraryfile">libtcl&tcl-ver;.so</filename></term>
        <listitem>
          <para>
            contains the API functions required by
            <application>Tcl</application>.
          </para>
          <indexterm zone="tcl libtcl">
            <primary sortas="c-libtcl">libtcl&tcl-ver;.so</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>
