# Building Version 9.4 of Icon from Source

Gregg M. Townsend
Department of Computer Science
The University of Arizona

www.cs.arizona.edu/icon/v940/build.htm
Last updated June 11, 2001

## Introduction

These instructions explain how to build and install the source code of Version 9.4 of Icon under Unix. For instructions on installing a binary release, see Installing Icon Binaries.

To the programmer, this version is upwards compatible with previous ones; but to the installer, there are some significant differences:

- The Icon program library is now part of the source distribution
- The built Icon system can be relocated without editing

A more detailed discussion of these changes is available separately.

These instructions assume that you have unpacked the Icon distribution file into a directory. All commands are issued in that directory.

## Configuring

The Icon source package contains configurations for a variety of Unix platforms. Type `make Configure` to see the list of known configurations. A status report for any system can be viewed by entering

> `make Status name=`name

Choose the configuration name that matches your system's architecture and operating system.

(If your system is not among those listed, you will need to port the code. This is usually a fairly simple matter that involves copying an existing configuration and editing it to match the target system. The file `ipl/cfuncs/mklib.sh` will also need a simple edit. Configuration parameters and context switch code are described in the appendixes of IPD238, Configuring the Source Code, www.cs.arizona.edu/icon/docs/ipd238.htm, although much of that document is now outdated.)

Most Unix systems include the X Window System; type

> `make X-Configure name=`name

to configure Icon with graphics. If your system does not include the X window system, type

> `make Configure name=`name

to configure Icon without graphics.

Installation using any of the supplied configurations should be routine, but some of those were contributed for systems we cannot test, and it is possible that some minor tweaking may be required. If so, or if you develop a new configuration, we'd like to hear about it by e-mail to icon-project@cs.arizona.edu.

## Building

After Configuring, type `make` to build the Icon system. This single step now builds:

- The icon translator and interpreter
- Program library procedures
- VIB and other graphics utilities, if graphics are enabled

There may be a few warnings on some platforms, but there should be no fatal errors. If there are problems, fix them in the `config/unix/`platform directory and repeat the configuration step.

## Testing

To verify a successful build, type `make Samples`. This command runs a small set of automated tests. If no differences are reported, you have a functioning Icon system.

A more extensive test set is run by `make Test`. One of these tests displays values of Icon keywords (such as `&date`) that can vary from run to run. No other differences should be reported.

A successful graphics build can be confirmed by executing `bin/colrbook`, the color book utility, with no arguments. It should display a spectrum of colors along the left and a set of recessed panes to the right. Click anywhere on the spectrum to fill colors in the panes. Click `QUIT` (in the upper left corner) to exit.

## Installing

Icon can be run directly from the location in which it was built. To do this, simply add the `bin` directory to your shell's search path. See the `icont` man page for instructions on building and running Icon programs.

If you wish to install the binaries elsewhere, choose a location for a directory dedicated to Icon -- for example, `/opt/icon` or `/usr/local/icon`. Enter

> `make Install dest=`directory

to create this directory (if necessary) and install Icon in its `bin`, `lib`, `doc`, and `man` subdirectories.

You can make symbolic links from other locations to programs in the Icon `bin` directory. For example, you can link `/usr/local/bin/icont` to `/opt/icon/bin/icont`. If you do this, link at least `icont`, `iconx`, and (if present) `vib`. You can additionally link any of the other executable utilities in the `bin` directory.

If you'd like to bundle up a gzipped tar file of the binaries created by the build process, enter `make Package`. Such a package can be used to install binaries on other systems of the same architecture.

## Cleaning Up

Type `Make Clean` to remove intermediate files created during the build process. This command preserves the contents of the `bin` and `lib` directories, so the built system remains functional.

To restore everything to its original state, type `make Pure`. This removes all the newly built files and requires restarting at the configuration step for a rebuild.