Compile TLC Python Before You Start: Try Activetcl Activestate
Compile TLC Python Before You Start: Try Activetcl Activestate
Try ActiveTcl. ActiveState provides easy-to-install binaries of Tcl for many platforms.
Make sure you have the most recent patch release (8.6.4). Look in the FTP directory from
which you retrieved this distribution to see if it has been updated with patches. Patch
releases fix bugs, so you should normally use the latest patch release for the version of
Tcl that you want.
cd tcl8.5.0/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-prefixoptions.
configure --prefix=/home/user/tcl
--enable-threads
If this switch is set, Tcl will compile itself with multithreading support.
--enable-shared
If this switch is specified (the default), Tcl will compile itself as a shared library if it can
figure out how to do that on this platform. Add =no will create a static build.
--enable-symbols
If this switch is specified, Tcl will build with debugging symbols.
If you wish to specify a particular compiler, set the CC environment variable before
calling configure. You can also specify CFLAGS prior to configure and they will be used
during compilation.
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 unixsubdirectory. 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.
cd /home/user/src/tcl8.5.0/unix
mkdir solaris
cd solaris
/home/user/src/tcl8.5.0/unix/configure \
--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.5.0/unix
mkdir solaris
cd solaris
/home/user/src/tk8.5.0/unix/configure \
--with-tcl=/home/user/src/tcl8.5.0/unix/solaris \
--prefix=/usr/local \
--exec-prefix=/usr/local/solaris-sparc
What is Make?
After you configure your Makefile, type "make". This will create a library archive
called libtcl.a or libtcl.soand 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.
Compiling on Windows
In order to compile Tcl for Windows, you need the following items:
In the win subdirectory of the source release, you will find makefile.vc. This is the
makefile for the Visual C++ compiler. You should update the paths at the top of the file
to reflect your system configuration. Now you can use make (or nmake for VC++) to build
the tcl libraries and the tclsh executable.
make install
to place the Tcl script library files someplace where Tcl can find them. Tcl looks in the
following places for the library files:
Note that in order to run tclsh85.exe, you must ensure that tcl85.dll is on your path in
the system directory, or in the directory containing tclsh85.exe.
Compiling Tk for windows follows a similar process. You must compile Tcl before you
compile Tk.
If you are compiling a Tcl extension for windows, please see the TEA reference.
--enable-framework
Builds the shared libraries as Mac OS X Frameworks.
--enable-aqua
Target the Aqua windowing system instead of X11 on Mac OS X.