[ Team LiB ] Previous Section Next Section

Standard Directory Structure

The Source Distribution

Table 48-1 describes the directory structure of the Tcl source distribution. The Tk distribution is similar, and you should model your own source distribution after this. It is also standard to place the Tcl, Tk, and other source packages under a common source directory (e.g., /usr/local/src or /home/welch/cvs). In fact, this may be necessary if the packages depend on each other.

Table 48-1. The Tcl source directory structure

tcl8.4

The root of the Tcl sources. This contains a README and license_terms file, and several subdirectories.

tcl8.4/compat

This contains .c files that implement procedures that are otherwise broken in the standard C library on some platforms. They are only used if necessary.

tcl8.4/doc

This contains the reference documentation. Currently this is in nroff format suitable for use with the UNIX man program. The goal is to convert this to XML.

tcl8.4/generic

This contains the generic .c and .h source files that are shared among Unix, Windows, and Macintosh.

tcl8.4/mac

This contains the .c and .h source files that are specific to Macintosh. It also contains Code Warrior project files.

tcl8.4/library

This contains init.tcl and other Tcl files in the standard Tcl script library.

tcl8.4/library/encoding

This contains the Unicode conversion tables.

tcl8.4/library/package

There are several subdirectories (e.g., http2.3) that contain Tcl script packages.

tcl8.4/test

This contains the Tcl test suite. These are Tcl scripts that exercise the Tcl implementation.

tcl8.4/tools

This is a collection of scripts used to help build the Tcl distribution.

tcl8.4/unix

This contains the .c and .h source files that are specific to UNIX. This also contains the configure script and the Makefile.in template.

tcl8.4/unix/dltest

This contains test files for dynamic loading.

tcl8.4/unix/platform

These can be used to build Tcl for several different platforms. You create the package directories yourself.

tcl8.4/win

This contains the .c and .h source files that are specific to Windows. This also contains the configure script and the Makefile.in template. This may contain a makefile.vc that is compatible with nmake.

The Installation Directory Structure

When you install Tcl, the files end up in a different arrangement than the one in the source distribution does. The standard installation directory is organized so that it can be shared by computers with different machine types (e.g., Windows, Linux, and Solaris). The Tcl scripts, include files, and documentation are all in shared directories. The applications and programming libraries (i.e., DLLs) are in platform-specific directories. You can choose where these two groups of files are installed with the --prefix and --exec-prefix options to configure, which is explained in detail in the next section. Table 48-2 shows the standard installation directory structure:

Table 48-2. The installation directory structure

arch/bin

This contains platform-specific applications. On Windows, this also contains binary libraries (i.e., DLLs). Typical arch names are solaris-sparc, linux-ix86, and win-ix86.

arch/lib

This contains platform-specific binary libraries on UNIX systems (e.g., libtcl8.4.so)

bin

This contains platform-independent applications (e.g., Tcl script applications).

doc

This contains documentation.

include

This contains public .h files.

lib

This contains subdirectories for platform-independent script packages. Packages stored here are found automatically by the Tcl auto loading mechanism described in Chapter 12.

lib/tcl8.2

This contains the contents of the tcl8.4/library source directory, including subdirectories.

lib/package

This contains Tcl scripts for package. Example package directories include tk8.4 and itcl3.2.

man

This contains reference documentation in UNIX man format.

If you are an expert in configure, you may be aware of other options that give you even finer control over where the different parts of the installation go. However, because of the way Tcl automatically searches for scripts and binary libraries, you should avoid deviating from the recommended structure.

    [ Team LiB ] Previous Section Next Section