Linux HOWTOs

About | Home | Search


HOWTO: tcl
Description: Tool Command Language - text based script language
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# tcl 8.4.18
# ==========
# Slackware 9.0's 'tcl' package includes version 8.4.2, 9.1's includes
# 8.4.4, 10.0, 10.1's include 8.4.6, 10.2 includes 8.4.11, 11.0 includes
# 8.4.13, and 12.0 includes 8.4.15

# As I write this, 8.5.2 is available, but I'm going to stick with 8.4.x
# for the time being (I'm going from .13 -> .18), I'll upgrade to 8.5.x
# next time

# If you want to build a multi-threaded tcl, add --enable-threads to the
# configure lines below

cd
test -f installed/tcl8.4.18-src.tar.gz && mv installed/tcl8.4.18-src.tar.gz .
test ! -f tcl8.4.18-src.tar.gz &&
 wget http://download.sf.net/tcl/tcl8.4.18-src.tar.gz
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "tcl?.*.*" -exec rm -r {} \;
tar xzvf ~/tcl8.4.18-src.tar.gz
cd tcl8.4.18
test $UID = 0 && chown -R root:root .
cd unix
./configure --prefix=/usr --enable-man-symlinks --disable-shared
make
su -c "test -x /sbin/removepkg && /sbin/removepkg tcl ; make install"
make clean
./configure --prefix=/usr --enable-man-symlinks --enable-shared
make
make test

# Become root to install it
su

make install
( cd /usr/bin ; rm -f tclsh ; ln -sf tclsh8.4 tclsh )
( cd /usr/lib
  rm -f libtcl.a libtcl.so libtclstub.a
  ln -sf libtcl8.4.a libtcl.a
  ln -sf libtcl8.4.so libtcl.so
  ln -sf libtclstub8.4.a libtclstub.a )

# Become yourself again
exit

cd
mkdir -p -m 0700 installed
rm -f installed/tcl?.*-src.tar.*
mv tcl8.4.18-src.tar.gz installed/


# If you ever need to uninstall tcl, something like this should do it:
VER=`grep TCL_VERSION /usr/lib/tclConfig.sh | awk -F"'" '{ print $2 }'`
( cd /usr/bin ; rm -f /usr/bin/tclsh /usr/bin/tclsh${VER} )
( cd /usr/include ; rm -f tcl.h  tclDecls.h tclPlatDecls.h )
( cd /usr/lib ; rm -f tclConfig.sh libtcl.* libtcl${VER}.* libtclstub.a \
  libtclstub${VER}.a )
ldconfig
test -d /usr/lib/tcl${VER} && rm -r /usr/lib/tcl${VER}
unset VER
cd /usr/local/src/tcl8.4.18/unix
mkdir -p foo/man1 foo/man3 foo/mann
for mp in ../doc/*.1 ; do ./installManPage --symlinks $mp ./foo/man1 ; done
for mp in foo/man1/*.1 ; do rm /usr/man/man1/`basename $mp` ; done
for mp in ../doc/*.3 ; do ./installManPage --symlinks $mp ./foo/man3 ; done
for mp in foo/man3/*.3 ; do rm /usr/man/man3/`basename $mp` ; done
for mp in ../doc/*.n ; do ./installManPage --symlinks $mp ./foo/mann ; done
for mp in foo/mann/*.n ; do rm /usr/man/mann/`basename $mp` ; done
rm -r ./foo
cd
find /usr/local/src -type d -maxdepth 1 -name "tcl?.*" -exec rm -r {} \;
rm -f ~/installed/tcl?.*-src.tar.*

Back to the list


Last updated: Tue, 07 Aug 2018 12:06:17 -0400
Jason Englander <jason at englanders dot us>