# Icon on Macintosh

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

www.cs.arizona.edu/icon/v943/macintosh.htm
Last updated November 9, 2005

## Introduction

Because Mac OS X is based on Unix, it can run Icon. There is no special Macintosh interface, so as a practical matter Icon on the Mac is for those who are comfortable using a Unix shell in a Terminal window.

The command-line interface to Icon is described by Unix man pages. The `icon` command executes a program from a single source file. An Icon program in a simple text file `prog.icn` is executed by typing `icon prog.icn`. The more general `icont` command, modeled after the Unix cc command, supports multiple files, separate compilation, and other features.

## Graphics

For graphics, Icon uses the X Window System, generally called X11 in Macintosh documentation. X11 is not normally installed as part of OS X; it must be selected as part of a custom installation. Alternatively, it can be downloaded from Apple.

The X window system does not start automatically. To run an Icon graphics program, you must first start the X11 application and leave it running. The environment variable DISPLAY must be set in the shell that runs an Icon graphics program. For example:

> `setenv DISPLAY :0.0`

## Building Icon

Building Icon from source requires the Xcode toolbox. This comes in an extra folder on the OS X installation disc. When installing XCode, be sure to select a custom installation and add X11 to the default set.

Icon is built in a Terminal window. The process is the same as on other platforms and uses the configuration named `macintosh`. See Building Icon for detailed instructions.