Hello,
Download source from
Gzip format tcl8.4.16-src.tar.gz
gunzip < file.tar.gz | tar xvf -
Zip format tcl8416-src.zip
Configuring and Compiling on UNIX
Compiling Tcl on UNIX has two steps: configure and make. In the simplest case you type the following commands to your shell:
cd tcl8.4.16/unix
configure options
make
make test
make install
Configure
The configure script tests your system for different compilation and linking options and generates a Makefile. The configure script is created by GNU autoconf. There are two commonly-specified configure options:
–prefix=directory
This flag specifies the installation directory. The default is /usr/local.
–exec-prefix=directory
This flag specifies the installation directory for architecture-specific (i.e., binary) files. The default is to install architecture-specific files into the location specified by –prefix. This is typically set to a subdirectory of the main prefix, (e.g., /usr/local/solaris-sparc) for sites that want to maintain binaries for multiple architectures. If you just have a single system type, then you can ignore this option.
Note: be sure to use only absolute path names (those starting with “/”) in the –prefix and –exec-prefix options.
To install into the directories /home/user/tcl/bin and /home/user/tcl/lib, for example, you should configure with:
configure –prefix=/home/user/tcl
Tcl’s configure supports the following special switches in addition to the standard ones:
–enable-gcc
If this switch is set, Tcl will configure itself to use gcc if it is available on your system. Note: it is not safe to modify the Makefile to use gcc after configure is run; if you do this, then information related to dynamic linking will be incorrect.
–enable-threads
If this switch is set, Tcl will compile itself with multithreading support.
–disable-load
If this switch is specified then Tcl will configure itself not to allow dynamic loading, even if your system appears to support it. Normally you can leave this switch out and Tcl will build itself for dynamic loading if your system supports it.
–enable-shared
If this switch is specified, Tcl will compile itself as a shared library if it can figure out how to do that on this platform. This is now the default.
Configuring for multiple architectures
Suppose you are building for two platforms, Linux and Solaris, and your installation will be shared by both kinds of hosts. You’ll want to use the –exec-prefix configure option to specify different binary installation directories.
There are two ways you can build for multiple platforms. The first way is to build both platforms in the unix subdirectory. First configure and build for one platform. After you install, type make distclean and then configure and build for the second platorm. Be sure that both the configure and build steps are run on the platform for which you are building. For example, don’t configure under Solaris and then build under HP-UX.
You can also build the different platforms in different subdirectories of the unix directory. If you do this, then you must name the configure script with a full pathname. For example:
cd /home/user/src/tcl8.4.16/unix
mkdir solaris
cd solaris
/home/user/src/tcl8.4.16/unix/configure \
–enable-gcc –enable-shared \
–prefix=/usr/local \
–exec-prefix=/usr/local/solaris-sparc
Configuring Tk
When you configure Tk you may need to tell it where Tcl was built with the –with-tcl flag. This is true, for example, if you build Tcl in a subdirectory of unix as just described. To configure Tk:
cd /home/user/src/tk8.4.16/unix
mkdir solaris
cd solaris
/home/user/src/tk8.4.16/unix/configure \
–enable-gcc –enable-shared \
–with-tcl=/home/user/src/tcl8.4.16/unix/solaris \
–prefix=/usr/local \
–exec-prefix=/usr/local/solaris-sparc
Building with Make
What is Make?
After you configure your Makefile, type “make”. This will create a library archive called libtcl.a or libtcl.so and an interpreter application called tclsh that allows you to type Tcl commands interactively or execute script files. When you build Tk, you create libtk.a or libtk.so and the wish executable.
Type “make test” to run an exhaustive test suite. In most cases there should not be test failures. The Tk test suite, however, does have some tests that depend on font metrics and the window manger, which can vary across platforms. The README file in the tests subdirectory has documentation about the test suite.
Type “make install” to install Tcl binaries and script files in the directories you specified with –prefix or –exec-prefix during the configure step. You’ll need write permission on the installation directories to do this.
If you have trouble compiling Tcl, check out the platforms list. This is an on-line database of porting information. We make no guarantees that this information is accurate, complete, or up-to-date, but you may find it useful. If you get Tcl running on a new configuration, we would be happy to receive new information to add to the database. We’re also interested in hearing how to change the configuration setup so that Tcl compiles out of the box on more platforms.