| 1 |
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 |
<HTML> |
| 3 |
<HEAD> |
| 4 |
<META NAME=viewport CONTENT="width=device-width, initial-scale=1"> |
| 5 |
<TITLE>Icon on Cygwin</TITLE> |
| 6 |
<LINK REL="STYLESHEET" TYPE="text/css" HREF="istyle.css"> |
| 7 |
<LINK REL="SHORTCUT ICON" HREF="shortcut.gif"> |
| 8 |
</HEAD> |
| 9 |
<BODY> |
| 10 |
|
| 11 |
<P><A HREF="http://www.cs.arizona.edu/icon/"> <IMG SRC="wwwcube.gif" |
| 12 |
ALT="[Icon home]" WIDTH=128 HEIGHT=144 BORDER=0 ALIGN=RIGHT> </A> |
| 13 |
|
| 14 |
<H1> Icon on Cygwin </H1> |
| 15 |
|
| 16 |
<P> Gregg M. Townsend |
| 17 |
<BR> <SMALL> Department of Computer Science </SMALL> |
| 18 |
<BR> <SMALL> The University of Arizona </SMALL> |
| 19 |
|
| 20 |
<P> Carl Sturtivant |
| 21 |
<BR> <SMALL> Computer Science & Engineering Department </SMALL> |
| 22 |
<BR> <SMALL> University of Minnesota </SMALL> |
| 23 |
|
| 24 |
<P> <SMALL> www.cs.arizona.edu/icon/uguide/cygwin.htm |
| 25 |
<BR> |
| 26 |
Last updated June 5, 2013</SMALL> |
| 27 |
|
| 28 |
|
| 29 |
<H2> Introduction </H2> |
| 30 |
|
| 31 |
<P> Most contemporary operating systems trace their underlying design |
| 32 |
to the Unix operating system, |
| 33 |
as refined and specified today by the POSIX family of standards. |
| 34 |
Microsoft Windows, however, was developed independently and |
| 35 |
defines a different set of interfaces for the programmer and the user. |
| 36 |
|
| 37 |
<P> The <A HREF="http://www.cygwin.com/">Cygwin</A> package provides a |
| 38 |
Unix environment under Microsoft Windows. |
| 39 |
This allows the latest version of Icon (and many other things) |
| 40 |
to be built on a Windows system. |
| 41 |
Successful use of Cygwin requires familiarity with both |
| 42 |
Windows and Unix. |
| 43 |
|
| 44 |
<P> This document describes some of the peculiarities of the Cygwin |
| 45 |
port of Icon. |
| 46 |
These differences are not necessarily identified in other documentation. |
| 47 |
|
| 48 |
|
| 49 |
<H2> Building Icon </H2> |
| 50 |
|
| 51 |
<P> Icon is built in a Cygwin shell window using the same process as on |
| 52 |
on other platforms. |
| 53 |
The configuration name is <CODE>cygwin</CODE>. |
| 54 |
See the <A HREF=build.htm>installation documentation</A> for instructions. |
| 55 |
|
| 56 |
<P> The Cygwin package is available from |
| 57 |
<A HREF="http://www.cygwin.com/">www.cygwin.com</A>. |
| 58 |
A custom installation of the Cygwin system is required; |
| 59 |
the default installation provides a bare-bones system |
| 60 |
insufficient for building software. |
| 61 |
Icon requires a C compiler and the usual tools and utilities |
| 62 |
available on a standard POSIX development system; these are found |
| 63 |
in the <CODE>gcc-core</CODE> and <CODE>make</CODE> packages. |
| 64 |
|
| 65 |
<P> Additional Cygwin/X packages must also be included in the installation |
| 66 |
if Icon is to be built with graphics enabled. |
| 67 |
The necessary packages are detailed at |
| 68 |
<A HREF="http://x.cygwin.com">x.cygwin.com</A>. |
| 69 |
|
| 70 |
|
| 71 |
<H2> Running Icon programs </H2> |
| 72 |
|
| 73 |
<P> Icon is run by commands entered in a Cygwin terminal window. |
| 74 |
The simplest command is "<CODE>icon prog.icn</CODE>", |
| 75 |
which runs the program contained in the source file <CODE>prog.icn</CODE>. |
| 76 |
The translator <CODE>icont</CODE> can create executable programs |
| 77 |
from Icon source code. |
| 78 |
The Unix-style "man pages" for <A HREF=icon.txt><CODE>icon</CODE></A> |
| 79 |
and <A HREF=icont.txt><CODE>icont</CODE></A> |
| 80 |
describe the command options in a traditionally cryptic manner. |
| 81 |
|
| 82 |
|
| 83 |
<H2> Interpreter path and environment</H2> |
| 84 |
|
| 85 |
<P> Icon programs require an interpreter for execution. |
| 86 |
On Windows, the path of the interpreter is not embedded |
| 87 |
in an executable program. |
| 88 |
The program must be able to find |
| 89 |
<CODE>iconx.exe</CODE> in the search path. Icon programs |
| 90 |
must be run from a Cygwin command shell or xterm window. |
| 91 |
|
| 92 |
<P> The <A HREF="http://x.cygwin.com">Cygwin/X</A> |
| 93 |
server must be running, with a correct <CODE>DISPLAY</CODE> |
| 94 |
variable in the environment, to execute graphics programs. |
| 95 |
The Cygwin installation must therefore include Cygwin/X, |
| 96 |
in which case the X server may be started from |
| 97 |
a shortcut or the Start menu in Windows 7, before a command is issued |
| 98 |
to execute such a graphics program. |
| 99 |
|
| 100 |
|
| 101 |
<H2> Feature test symbols </H2> |
| 102 |
|
| 103 |
<P> The symbols <CODE>_MS_WINDOWS</CODE> and <CODE>_CYGWIN</CODE> |
| 104 |
are defined by the Icon preprocessor. |
| 105 |
The symbol <CODE>_UNIX</CODE> is not defined. |
| 106 |
The symbol <CODE>_GRAPHICS</CODE> is defined if Icon is built with |
| 107 |
graphics enabled, as is the symbol <CODE>_X_WINDOW_SYSTEM</CODE>. |
| 108 |
The corresponding strings are produced or omitted, as appropriate, |
| 109 |
by the <CODE>&features</CODE> keyword. |
| 110 |
|
| 111 |
|
| 112 |
<H2> Building dynamic libraries of loadable C code </H2> |
| 113 |
|
| 114 |
<P> The Icon function <CODE>loadfunc</CODE> allows |
| 115 |
specially written C code to be loaded and called by an Icon program. |
| 116 |
See <A HREF="cfuncs.htm">Loading C Functions in Icon</A>. |
| 117 |
|
| 118 |
<P> When building a <CODE>loadfunc</CODE> library under Cygwin, |
| 119 |
link to the import library <CODE>iconx.a</CODE> located in the |
| 120 |
<CODE>bin</CODE> directory of the Icon distribution. |
| 121 |
This allows callbacks to functions in <CODE>iconx</CODE>, |
| 122 |
which happens by default on UNIX-like platforms but not on Windows. |
| 123 |
|
| 124 |
<HR> |
| 125 |
|
| 126 |
</BODY> |
| 127 |
</HTML> |