# Building the Unix Binaries

### 1. Download the Tcl, Tk and/or Itcl sources

You may have already installed Tcl, Tk and Itcl on your system. The installed binaries usually reside in the /usr/local/ directory. However, the build process of Tix doesn't use the installed binaries because doing that may result in subtle version conflects. Instead, Tix uses only the binaries from the Tcl, Tk and Itcl source directories. Install sources of these packages if they are not already in your system.

- Tcl 8.0, 8.1 8.2 and 8.3: The source code of these Tcl releases can be found at http://tcl.activestate.com. Remember to download the source code of the corresponding versions of Tk as well.

- Itcl 3.0 and 3.1: Download the source code from ftp://www.tcltk.com/pub/itcl

Make sure that the source directory of these package reside in the same directory as Tix. For example, to compile Tix 8.1.2 for Tcl 8.3 and Itcl 3.0, a typical source directory would look like this:

>       /home/src/tcl8.3.3/
>       /home/src/tk8.3.3/
>       /home/src/itcl3.0/
>       /home/src/tix-8.1.2/

IMPORTANT: Do not arrange your source directory in any other way. Do not change the names for these directories. Otherwise Tix will not be configured properly.

### 2. Configure and compile the desired version(s) of Tcl and/or Itcl

Tcl, Tk and Itcl comes with installation guides and should be easy to build. In case you have any problems building these packages, you can send your questions to the comp.lang.tcl newsgroup or to the respective authors of these packages.

For example, assuming your source directory is structured as above, you can build Tcl 8.3 and Tk 8.3 by issuing the following Unix commands:

>       cd /home/src/tcl8.3/unix
>       ./configure --enable-shared
>       make
>       cd /home/src/tk8.3/unix
>       ./configure --enable-shared
>       make

### 3. Configure and compile Tix

1. Make sure you have configured and build the desired version(s) of Tcl and/or Itcl.

2. Change into the `tix-8.1.2/unix` directory and execute the configure script:

   >       cd /home/src/tix-8.1.2/unix
   >       ./configure

3. Inside the `tix-8.1.2/unix` directory, you will see several subdirectories for building Tix for specific version of Tcl/Tk or Itcl. Change into the appropriate subdirectory. For example, if you want to build Tix for Tcl8.3/Tk8.3, execute the following commands:

   >       cd tk8.3
   >       ./configure --enable-shared
   >       make

   Before you run the `configure` script, you can type:

   >       ./configure --help

   to find out the available options.
4. Repeat step 3 for any other versions of Tcl/Tk or Itcl that you want to build Tix for.

### 4. Experimenting with Tix

When you finish building Tix, you will find the `tixwish` program inside the build directories (e.g., `tix-8.1.2/unix/tk8.3/tixwish`). Or, if you build Tix for Itcl, the program will be called `itixwish`.

Tix comes with a number of demo programs. You can run these program by running the demos/widget script with tixwish or itixwish. Make sure that you have set the TIX_LIBRARY variable accordingly (see below). If you haven't installed Tcl and/or Tk then you'll need to set your TCL_LIBRARY and TK_LIBRARY environment variable as well (see the Tcl and Tk README files for information on this).

You can type the following command in your shell:

>       cd /home/src/tix-8.1.2/demos
>       env TIX_LIBRARY=/home/src/tix-8.1.2/library ../unix/tk8.3/tixwish widget

This will open up the Tix demo window. You can click on the "Run Sample Programs" tab and execute the sample programs:

(Screen 4.1 Tix widget demostration program)

### 5. Installing Tix

If you are sufficiently convinced that Tix works properly, you can install the Tix binaries and scripts on your system. If you are paranoid, these is a small set of test scripts that tests the behavior of Tix under various configurations. You can do this by typing "make tests" inside the build-subdirectories, e.g.:

>       cd /home/src/tix-8.1.2/unix/tk8.3
>       make tests

Hopefully it will report "0 error(s) found".

Type "make install" to install Tix's binaries and script files in standard places:

>       cd /home/src/tix-8.1.2/unix
>       make install

In the default configuration information will be installed in /usr/local so you'll need write permission on this directory. If you'd like to use a different installation directory, you can specify the "--exec-prefix" and "--prefix" options for the configure script in step 3 and then rebuild Tix.

### 6. Trouble Shooting

If make fails then you'll have to personalize the Makefile's for your site or possibly modify the distribution in other ways. First check the files FAQ.html and Porting.html to see if there are hints for compiling on your system. If you need to modify Makefile's, there are comments at the beginning of it that describe the things you might want to change and how to change them.

If you have trouble compiling Tix, I'd suggest looking at the files FAQ.html and Porting.html. It contains information that people have sent me about changes they had to make to compile Tix in various environments.

I make no guarantees that this information is accurate, complete, or up-to-date, but you may find it useful. If you get Tix running on a new configuration and had to make non-trivial changes to do it, I'd be happy to receive new information. I'm also interested in hearing how to change the configuration setup so that Tix compiles on additional platforms "out of the box".