1XV Installation Instructions
2============================
3Note: While an 'Imakefile' has been provided for you, I *strongly* recommend
4that you using the regular 'Makefile', as that's what I use.
5
6Edit 'config.h'.
7
8Edit the Makefile, and make appropriate changes, if any.  See notes below.
9
10Also Note:  The tiff library *REQUIRES* an ANSI C compiler.  Trying to build
11it with an old K&R-style C compiler will be painful, and probably a waste of
12time.  If your vendor-supplied C compiler (if any!) doesn't handle ANSI C,
13you're encouraged to get a copy of 'gcc' from prep.ai.mit.edu, in pub/gnu.
14In the interim, if you are unable to build the TIFF library, it is easy
15enough to disable XV's TIFF support in the XV Makefile.
16
17Do a 'make' to (hopefully) build XV, but read the system-specific notes below
18FIRST.
19
20
21--------------------------------
22If you *insist* on using imake, do this, it might work:
23  cd jpeg ; ./configure ; make libjpeg.a ; cd ..
24  xmkmf
25  make Makefiles
26  make depend
27  make
28
29(By the way, if the 'imake' goes awry, there are backups of the original
30 minimalist Makefiles in 'Makefile.std' and 'tiff/Makefile.std'.  imake
31 doesn't touch the jpeg/Makefile, so don't worry about that one.)
32--------------------------------
33
34
35The following are installation instructions for some of the more common
36types of systems.
37
38	--------------------------------------------------------------
39        DECstations (alpha) running OSF/1
40	DECstations (mips) running Ultrix
41	SUNs running SunOS 4.x and MIT's X11R4 distribution
42	IBM RS/6000s running AIX (using IBM's 'cc')
43
44	On these machines, you should be able to just type 'make' and
45	have everything compile cleanly.  (On the DECstation, you'll see
46	some warnings about some functions being too long to be optimized.
47	Ignore such messages, as those functions don't need to be
48	optimized.)
49
50        Note: Sun's 'cc' compiler is *not* ANSI-compatible.  You will *not*
51	be able to get the TIFF library compiled with it.  Either turn
52	off the tiff support (see the notes in the Makefile), or use 'gcc'.
53
54	--------------------------------------------------------------
55	SUNs running OpenWindows
56
57	By default the Makefile assumes your X11 include files and the
58	libX11.a library are in the 'normal places' (/usr/include/X11/*.h and
59	/usr/lib/libX11.a) If this is not the case on your system, (as is
60	often the case on Suns running OpenWindows) you should add '-L' and
61	'-I' options on the CCOPTS line in the Makefile to tell the compiler
62	where to find said files.  See the Makefile for more details.
63
64	--------------------------------------------------------------
65	SUNs running Solaris 2.x
66
67	Turn on the '-DSVR4' option in the Makefile.  Also see the note
68	above if you're running OpenWindows.  You may also have to add
69	'-lsocket -lnsl' to the CCOPTS line, as the X11 library may
70	require the socket/networking libraries.
71
72	--------------------------------------------------------------
73	HP Workstations running HPUX 9.0
74
75	For HP workstations running HPUX 9.0 or later, set "CC = cc -Aa"
76	or "CC = gcc -ansi" in the Makefile, and uncomment the MCHN
77	definition for HPUX.  You'll also need to copy tiff/Makefile.hpux
78	to tiff/Makefile.  If you have HP's minimal C compiler that
79	doesn't accept the -Aa (ANSI) option, either use gcc or comment
80	out the TIFF options, because libtiff won't compile.
81
82	--------------------------------------------------------------
83	SGI IRIS running IRIX
84
85	Edit the Makefile, and turn on the SVR4 and SGI options
86
87	--------------------------------------------------------------
88	Other SVR4 systems
89
90	Edit the Makefile, and turn on the SVR4 option.
91
92	--------------------------------------------------------------
93	IBM RS/6000s running AIX and using gcc
94
95	Edit the Makefile, and add '-D_AIX' to the CCOPTS line.
96
97	--------------------------------------------------------------
98
99
100If you run into problems during the build, check the Makefile (or the
101Imakefile) for additional configuration options that may help.
102
103
104The following are things to be wary of when building XV, and some
105hints for building XV on some less-popular systems.
106
107
108GCC USERS: It is important that the XV source and the contents of the
109JPEG and TIFF subdirectories all be compiled with the same compiler.
110While this should normally be the case, as the value of the CC
111variable in the XV makefile is propogated to the makefiles in the
112subdirectories, it's something to keep in mind.  Also, you may need to
113specify '-traditional' when compiling with gcc, as it may blow up on
114some code in the TIFF subdirectory.
115
116
117GCC USERS: If you compile XV with gcc, and find XV crashing in the
118function 'vsprintf()', the gcc-specific include files on your system
119are screwed up.  You should get your sysadmin-type to fix the
120gcc-include files (you can test it by compiling 'vargs.c', a simple
121varargs-verification program in the unsupt directory), or alternately,
122just use 'cc' instead.
123
124
125HP USERS: If you are running HP-UX 7.* , you should remove the '-O'
126compiler flag from the Makefile.  The optimizer supplied with that
127version of the OS has been known to break code in xvgam.c (and
128possibly elsewhere, as well).  You'll know the optimizer has broken
129the code if pictures come out 'purple'.
130
131
132DECSTATION USERS: I've had a report that compiling 'xvevent.c' with
133the optimizer turned on (Ultrix 4.1, MIPS C compiler version 2.1)
134breaks the routine TrackPicValues().  I haven't been able to verify
135this behavior, but if you're building on this sort of system, you may
136want to turn optimization off, at least for that routine.
137
138
139IRIS/HP/Other SysV-based machines: If you find XV 'going out to lunch'
140when you click on any of the buttons in the controls window, (or do
141any of a number of other things), it is almost certainly a matter of
142configuring the 'Timer()' function (in xvmisc.c) to correctly wait the
143requested number of milliseconds.  This is one of those things that
144doesn't seem to be very well nailed down in the different variants of
145Unix.  IF you experience problems, take a look at that function, and
146add an '#ifdef' for your machine that makes it use the whatever the
147proper 'sleep for some number of milliseconds' call on your machine.
148(Could be poll(), usleep(), setitimer(), or possibly select(), and
149probably some others.)
150
151
152Once you've built the program succesfully, do a 'make install', which
153will copy the programs 'xv', 'bggen', 'xcmap', 'xvpictoppm' and
154'vdcomp' (if you want PDS/VICAR support) to wherever you like your
155binaries to live, and copy the files 'docs/xv.man', 'docs/xcmap.man',
156'docs/bggen.man' and 'docs/xvpictoppm.man' to the approprate man-page
157directory.  You can edit the Makefile to fine-tune these locations for
158your system.
159
160
161Note: also included in this distribution (in the unsupt directory) is
162'getweather', a dopey little shell script that you may want to run in
163a crontab entry every hour, on the half-hour or so.  It will
164automagically go out and get the current US weather map via anonymous
165ftp, and stick it in some standard place (normally
166/usr/local/lib/weather.gif).
167
168
169Finally, print out a copy of docs/xvdocs.ps on a PostScript printer.
170If you are unable to do so, and would like a printed copy of the
171manual, see the bit about ordering printed copies of the manual.
172
173
174Note: If you are using 'transcript 2.1' to drive your PostScript
175printer, you may run into a problem where the xvdocs.ps file prints in
176the wrong font (courier, or something, instead of helvetica).  This
177seems to be caused by 'psrv', which tries to reverse the pages of all
178PostScript files.  It fails on this PostScript file.  You (or the
179local system administrator) can temporarily fix this by replacing the
180line:
181  'REVERSE = /pkg/lib/ps/psrv'
182with
183  'REVERSE = /bin/cat'
184in the file /pkg/lib/ps/psint.sh.  (Your pathnames may vary.)
185
186
187Bizarrities
188-----------
189There are some known problems with running XV in conjunction with
190'dxwm'.  I'm hoping that that is now a defunct window manager, and
191that everybody who was using that will switch to mwm.  Whether this
192hope is well-founded or not is another matter entirely.  See the DXWM
193option in the Makefile/Imakefile.
194
195
196Problems with TWM and TVTWM
197---------------------------
198XV would appear to exercise a pair of bugs in the version of TWM in
199MIT's X11R4 Standard Distribution tape.  Perhaps they've been fixed by
200now.
201
202Colormap Installation: under twm, if you have multiple XVs running,
203and each has their own colormap, sometimes the colormap doesn't get
204properly installed if you move the mouse directly from one XV to the
205other, quickly, so that it doesn't see the mouse go into the root
206window, or any other window.  If you move the mouse outside the window
207and move it back in, it SHOULD install the colormap correctly.
208
209Colormap Installation: Note, if an alternate colormap is installed, it
210will ONLY be installed when the mouse is inside the IMAGE window.  It
211will not be installed when the mouse is in any other XV windows
212(except, possibly, the color editor window).  This is because I can't
213guarantee that the other windows will still have contrasting
214foreground/background colors when the alternate colormap is installed.
215It is assumed that if you put the mouse in a window, you will want to
216use that window, so you'd better be able to READ that window...
217
218There's a bug in my version of TWM that creeps up if you have
219titlebars turned off.  Essentially, XV tells the window manager to
220make the window a certain size.  TWM (wrongly) adds enough room at the
221top to put its title bar there, but doesn't draw it, since titlebars
222are turned off.  XV gets back a ConfigureNotify event on the window
223with the new size, which is large by 20-odd pixels in height.
224
225There *used* to be a '-twmkludge' option in a previous version of xv
226to 'work around' this problem.  Unfortunately, this workaround
227introduced more problems than it solved, and has since been removed.
228The current thinking is: if you're using TWM, you should probably be
229using titlebars.  If you insist on not having titlebars, and your TWM
230doesn't behave properly, you should fix TWM.  (It's a one-line fix,
231and I'll gladly send it to anybody who asks for it.)
232
233
234Be sure to read the README file for shareware information, copyright notice,
235and other such things.
236
237--jhb,  12/19/94
238