xref: /netbsd-src/external/bsd/nvi/dist/build.unix/README.LynxOS (revision dbd550ed1a6686d6600f748306f9cc03d8cd4c94)
1*dbd550edSchristosREADME.LynxOS
2*dbd550edSchristos=============
3*dbd550edSchristos
4*dbd550edSchristosWritten by Ronald F. Guilmette <rfg@monkeys.com>
5*dbd550edSchristos
6*dbd550edSchristosLast modified Wed Aug 14 23:10:07 PDT 1996
7*dbd550edSchristos------------------------------------------
8*dbd550edSchristos
9*dbd550edSchristos0. Introduction
10*dbd550edSchristos---------------
11*dbd550edSchristos
12*dbd550edSchristosThis file describes how to build and install the Berkeley nvi editor for
13*dbd550edSchristosthe LynxOS 2.4.0 operating system.
14*dbd550edSchristos
15*dbd550edSchristosLynxOS 2.4.0 is available for a variety of different hardware platforms, in
16*dbd550edSchristosparticular, x86, m680x0, Sparc, and PowerPC.  I have successfully built nvi
17*dbd550edSchristoson all four of these flavors of LynxOS by following the procedures given in
18*dbd550edSchristosthis file.
19*dbd550edSchristos
20*dbd550edSchristosNote that these procedures may not work on versions of LynxOS prior to 2.4.0.
21*dbd550edSchristos(As I understand it, a good deal of work went into making the 2.4.0 release
22*dbd550edSchristosmore POSIX-compliant, and I have no idea what build glitches, if any, you
23*dbd550edSchristosmight encounter if you try to build nvi on a pre-2.4.0 version of LynxOS.)
24*dbd550edSchristos
25*dbd550edSchristosThere are basically four steps to configuring, building, and installing nvi
26*dbd550edSchristoson LynxOS, namely:
27*dbd550edSchristos
28*dbd550edSchristos	1.  Get setup to use the proper C compiler.
29*dbd550edSchristos	2.  Replace your installed `tr' program.
30*dbd550edSchristos	3.  Fix your system include files.
31*dbd550edSchristos	4.  Do a normal configure, build, and install of nvi.
32*dbd550edSchristos
33*dbd550edSchristosThese steps are described in separate sections below.
34*dbd550edSchristos
35*dbd550edSchristos1.  Get Setup to Use the Proper C Compiler
36*dbd550edSchristos------------------------------------------
37*dbd550edSchristos
38*dbd550edSchristosThe first step when building nvi on LynxOS is to set your $PATH environment
39*dbd550edSchristosvariable properly so that the gcc 2.x compiler appears first on your path,
40*dbd550edSchristosprior to the older (and less robust) gcc 1.xx compiler (typically installed
41*dbd550edSchristosas /bin/gcc) and/or the old Lynx proprietary C compiler (typically installed
42*dbd550edSchristosas /bin/cc), both of which may also be present on your system.
43*dbd550edSchristos
44*dbd550edSchristosNote that for most operating systems, the configure script for nvi tries
45*dbd550edSchristosto use whatever compiler you have installed (and in your $PATH) as "cc",
46*dbd550edSchristoshowever in the special case of LynxOS, the configure script will auto-
47*dbd550edSchristosmatically try to find a "gcc" program on your $PATH in preference to a
48*dbd550edSchristoscompiler called "cc".  If the nvi configure script only find a compiler
49*dbd550edSchristoscalled "cc", that's OK.  It will still try to see if that is really just
50*dbd550edSchristosthe GNU C compiler installed under the name "cc".
51*dbd550edSchristos
52*dbd550edSchristosRegardless of the name however (be it "gcc" or "cc") the first C compiler
53*dbd550edSchristosin your $PATH should be some _recent_ (i.e. 2.0 or later) version of the
54*dbd550edSchristosGNU C compiler... and the nvi configure script now checks that this is the
55*dbd550edSchristoscase, and fails if it isn't.
56*dbd550edSchristos
57*dbd550edSchristosOddly enough, LynxOS 2.4.0 (and some prior versions) shipped with as many
58*dbd550edSchristosas three different C compilers installed, so it is important to set your
59*dbd550edSchristos$PATH environment variable carfully in order to get the proper C compiler
60*dbd550edSchristosto appear first in your $PATH.  You want to avoid having either the /bin/gcc
61*dbd550edSchristoscompiler or the /bin/cc compiler be the first C compiler in your $PATH.
62*dbd550edSchristos
63*dbd550edSchristosTo make sure that the GNU C version 2.x compiler which was shipped with your
64*dbd550edSchristosLynxOS system appears first on your path, you will need to either set your
65*dbd550edSchristos$PATH variable (for sh/bash/ksh users) or your $path variable (for csh/tcsh
66*dbd550edSchristosusers).  You can, of course, just do this at the shell command prompt, but
67*dbd550edSchristosit is probably better to actually edit this change into your .profile file
68*dbd550edSchristos(for sh/bash/ksh users) or into your .cshrc file (for csh/tcsh users).
69*dbd550edSchristos
70*dbd550edSchristosThe pathname of the directory that contains the GNU C version 2.x compiler
71*dbd550edSchristosis (unfortunately) dependent upon the exact type of LynxOS system you have.
72*dbd550edSchristos
73*dbd550edSchristosFor LynxOS 2.4.0 on x86 systems, gcc 2.x is located in:
74*dbd550edSchristos
75*dbd550edSchristos	/cygnus/94q4-lynxos-x86/bin
76*dbd550edSchristos
77*dbd550edSchristosFor LynxOS 2.4.0 on m680x0 systems, gcc 2.x is located in:
78*dbd550edSchristos
79*dbd550edSchristos	/cygnus/94q4-lynxos-68k/bin
80*dbd550edSchristos
81*dbd550edSchristosFor LynxOS 2.4.0 on Sparc systems, gcc 2.x is located in:
82*dbd550edSchristos
83*dbd550edSchristos	/cygnus/94q4-lynxos-usparc/bin
84*dbd550edSchristos
85*dbd550edSchristosFor LynxOS 2.4.0 on PowerPC systems, gcc 2.x is located in:
86*dbd550edSchristos
87*dbd550edSchristos	/cygnus/95q2-lynxos-ppc/bin
88*dbd550edSchristos
89*dbd550edSchristos(Note also that these locations may change in LynxOS 2.5.x and beyond.)
90*dbd550edSchristos
91*dbd550edSchristosAnyway, it is imperative that you setup your $PATH environment variable
92*dbd550edSchristos(*before* you do the configure step for nvi) so that the GNU C version 2.x
93*dbd550edSchristoscompiler appears in your $PATH before either the /bin/cc or /bin/gcc
94*dbd550edSchristoscompilers (if present).  If you fail to do this, the configure step for
95*dbd550edSchristosnvi will fail, because the compiler script actually checks (now) that the
96*dbd550edSchristoscompiler you are using (if your are on a LynxOS system) is gcc 2.0 or
97*dbd550edSchristoslater.
98*dbd550edSchristos
99*dbd550edSchristosTo make absolutely sure that you will be configuring and building nvi with
100*dbd550edSchristosthe proper C compiler (i.e. the GNU C version 2.x compiler on your system)
101*dbd550edSchristosyou should add the directory name listed above for your specific system type
102*dbd550edSchristosto your $PATH setting in your $HOME/.profile file.  (For csh/tcsh users, you
103*dbd550edSchristoswill instead want to add the relevant directory name to the setting of your
104*dbd550edSchristos$path variable in your ~/.cshrc file.)  Once you have added the proper direc-
105*dbd550edSchristostory name (from the list given above) to your $HOME/.profile file (or to your
106*dbd550edSchristos~/.cshrc file, if you are using csh or tcsh) you should log out completely
107*dbd550edSchristosand then log back into the system just to make sure your new $PATH/$path
108*dbd550edSchristossetting takes effect properly.
109*dbd550edSchristos
110*dbd550edSchristosWhen you finish making this adjustment to your $PATH (or $path), the most
111*dbd550edSchristosup-to-date version of gcc on your system should be available to you as the
112*dbd550edSchristosfirst `gcc' program on your $PATH.  You should verify that this is indeed the
113*dbd550edSchristoscase simply by typing `gcc -v' and then checking the version number reported
114*dbd550edSchristosby the compiler.  It should say either "2.6-94q4" or (on PowerPC systems) it
115*dbd550edSchristosshould say "2.6-95q2".  If you don't get these results, try again to set your
116*dbd550edSchristos$PATH (or $path) until you do.  You won't be able to build nvi until you are
117*dbd550edSchristosproperly setup to use gcc version 2.0 or later.
118*dbd550edSchristos
119*dbd550edSchristosPerforming the steps shown above will insure that your subsequent configura-
120*dbd550edSchristostion and build steps for nvi will make use of the most up-to-date version of
121*dbd550edSchristosgcc that was shipped with your Lynx operating system.  (Note that the versions
122*dbd550edSchristosof gcc which are currently shipping with LynxOS 2.4.0 are also somewhat out-
123*dbd550edSchristosof-date themselves, but they are still quite a bit newer and more bug-free
124*dbd550edSchristosand ANSI conformant that those other two C compilers, /bin/cc and /bin/gcc,
125*dbd550edSchristoswhich also ship with LynxOS 2.4.0.)
126*dbd550edSchristos
127*dbd550edSchristos(Note:  At present, LynxOS version 2.4.0 is the latest officially released
128*dbd550edSchristosversion of LynxOS, and all of the above information is accurate and correct
129*dbd550edSchristosfor LynxOS 2.4.0 as of the time of this writing.  However it is rumored that
130*dbd550edSchristosfuture releases of LynxOS may provide a still newer version of gcc, and that
131*dbd550edSchristosit may be located in the /usr/bin directory.  Thus, if you are building nvi
132*dbd550edSchristosfor some LynxOS version later than 2.4.0, you may wish to check and see if
133*dbd550edSchristosyour system has a program called /usr/bin/gcc, and use that version of gcc,
134*dbd550edSchristosif available, rather than the one suggested above.)
135*dbd550edSchristos
136*dbd550edSchristos2.  Replace Your Installed `tr' Program
137*dbd550edSchristos---------------------------------------
138*dbd550edSchristos
139*dbd550edSchristosThe `tr' program which comes bundled with LynxOS 2.4.0 (as /bin/tr) has a
140*dbd550edSchristossomewhat obscure bug which just happens to be tickled by almost all GNU
141*dbd550edSchristos`autoconf' generated `configure' scripts (including the one that nowadays
142*dbd550edSchristoscomes bundled with nvi).  Using the stock /bin/tr program on LynxOS when
143*dbd550edSchristosexecuting such `configure' scripts _will_ cause these scripts to malfunction
144*dbd550edSchristosin various ways.  It is therefore imperative that you replace your LynxOS
145*dbd550edSchristos/bin/tr program with a properly working version of the `tr' command _before_
146*dbd550edSchristosyou even try to configure nvi.  (You can tell if your `tr' program has the
147*dbd550edSchristosbug by executng the command "echo ab- | tr ab- ABC".  If this yields the
148*dbd550edSchristosstring "Ab-" then you have the bug.  If it yields "ABC" then you don't.)
149*dbd550edSchristos
150*dbd550edSchristosYou can obtain sources for a working version of the `tr' command as part of
151*dbd550edSchristosthe GNU `textutils' package (the latest version of which, at the time of this
152*dbd550edSchristoswriting, is 1.19).  The GNU textutils package is available for downloading
153*dbd550edSchristosfrom prep.ai.mit.edu in the pub/gnu directory.  Look for the file named
154*dbd550edSchristostextutils-1.19.tar.gz, or an even more recent version of textutils, if one
155*dbd550edSchristosis available.  Fetch it, gunzip it, untar it, and follow the directions in
156*dbd550edSchristosthe INSTALL file included in the tar file to build and install the entire
157*dbd550edSchristostextutils set of utility programs (which includes a working `tr' program).
158*dbd550edSchristosThen just make sure that the GNU version of `tr' appears on your $PATH
159*dbd550edSchristos_before_ the LynxOS version of `tr' (i.e. /bin/tr).  Be sure to do this
160*dbd550edSchristosstep _before_ you start to configure nvi.
161*dbd550edSchristos
162*dbd550edSchristosWhen building the textutils set of programs, I suggest that you use the most
163*dbd550edSchristosup-to-date C compiler available on your system (as described above).  Also,
164*dbd550edSchristosnote that it will be important for you to AVOID using the -O (optimize)
165*dbd550edSchristoscompiler option when building the GNU textutils package, even if you are
166*dbd550edSchristosusing the most up-to-date version of gcc which shipped with your system.
167*dbd550edSchristosIf you try to use -O when building the textutils package on an x86 with
168*dbd550edSchristosthe Cygnus 94q4 C compiler, you will end up with a `tr' program which will
169*dbd550edSchristosmalfunction even worse than the one you are trying to replace!  If you use
170*dbd550edSchristos-O when building the textutils package on LynxOS on the PowerPC (using the
171*dbd550edSchristosCygnus 95q2 C compiler) you will just get yourself a compiler crash.  So
172*dbd550edSchristosjust don't use -O when building textutils.  You can avoid using -O by in-
173*dbd550edSchristosvoking make in the textutils directory as follows:
174*dbd550edSchristos
175*dbd550edSchristos	make CFLAGS="-g"
176*dbd550edSchristos
177*dbd550edSchristos(Note:  At present, LynxOS version 2.4.0 is the latest officially released
178*dbd550edSchristosversion of LynxOS, and all of the above information is accurate and correct
179*dbd550edSchristosfor LynxOS 2.4.0 as of the time of this writing.  However it is rumored that
180*dbd550edSchristosthe bug in the /bin/tr program will be fixed in future releases of LynxOS,
181*dbd550edSchristosso if you have a version of LynxOS later than 2.4.0, you may wish to check
182*dbd550edSchristosand see if your /bin/tr program even has the problematic bug before bothering
183*dbd550edSchristoswith all of this.)
184*dbd550edSchristos
185*dbd550edSchristos
186*dbd550edSchristos3.  Fix Your System Include Files
187*dbd550edSchristos---------------------------------
188*dbd550edSchristos
189*dbd550edSchristosIf you are building nvi on a PowerPC system, it is also important that you
190*dbd550edSchristosapply the patches given at the end of this file to your /usr/include files.
191*dbd550edSchristos(Note that you will have to be root in order to do this.)  Two of the patches
192*dbd550edSchristosincluded below fix a pair of serious bugs in the /usr/include/stdarg.h file
193*dbd550edSchristoson the PowerPC, and you really _do_ want to have these bugs fixed anyway,
194*dbd550edSchristosbecause without these fixes, anything that you compile which uses <stdarg.h>
195*dbd550edSchristoswill very likely malfunction at run-time.
196*dbd550edSchristos
197*dbd550edSchristosRegardless of which LynxOS platform you are using (i.e. x86, PowerPC, Sparc,
198*dbd550edSchristosor m680x0) you may want to apply all of the system include files patches that
199*dbd550edSchristosare included below anyway.  Doing so will clean up a few minor problems with
200*dbd550edSchristosthe relevant system include files (i.e. <stdarg.h>, <ioctl.h>, and <wait.h>)
201*dbd550edSchristosand this step will also prevent a few warnings which you would otherwise get
202*dbd550edSchristosduring the build of nvi.
203*dbd550edSchristos
204*dbd550edSchristosYou can apply all of the patches given at the end of this file simply by
205*dbd550edSchristosdoing the following:
206*dbd550edSchristos
207*dbd550edSchristos	su root
208*dbd550edSchristos	cd /usr/include
209*dbd550edSchristos	/bin/patch < this-file
210*dbd550edSchristos
211*dbd550edSchristosWhere `this-file' is the actual full pathname of the file you are now reading,
212*dbd550edSchristoswherever it may reside on your own system.
213*dbd550edSchristos
214*dbd550edSchristos(Note:  At present, LynxOS version 2.4.0 is the latest officially released
215*dbd550edSchristosversion of LynxOS, and all of the above information is accurate and correct
216*dbd550edSchristosfor LynxOS 2.4.0 as of the time of this writing.  However it is rumored that
217*dbd550edSchristosfuture releases of LynxOS may incorporate some or all of the important system
218*dbd550edSchristosinclude file fixes provided below.  Thus, if you are building nvi for some
219*dbd550edSchristosLynxOS version later than 2.4.0, you should probably go ahead and try to
220*dbd550edSchristosapply the patches given below to your system include files, and then just
221*dbd550edSchristosdon't worry about it if these patches seem to have already been applied.)
222*dbd550edSchristos
223*dbd550edSchristos
224*dbd550edSchristos4.  A Brief Note about Sendmail
225*dbd550edSchristos-------------------------------
226*dbd550edSchristos
227*dbd550edSchristosI should mention also that LynxOS does not normally ship with the `sendmail'
228*dbd550edSchristosmail transfer program installed, either under /usr/lib/ or anywhere else for
229*dbd550edSchristosthat matter.  This isn't really a big problem, but nvi normally wants and
230*dbd550edSchristosexpects to have a sendmail program available so that it can send users notifi-
231*dbd550edSchristoscations (by mail) whenever a partially edited file is preserved by the editor
232*dbd550edSchristosin response to a sudden system crash, a sudden system shutdown, or an unexpect-
233*dbd550edSchristosed serial-line hangup.  You can configure and build nvi without any sendmail
234*dbd550edSchristosprogram installed on your system, but you will get warnings about its absence
235*dbd550edSchristoswhen you are doing the initial configure step prior to actually building nvi.
236*dbd550edSchristosIf you want to have a fully-functional nvi which does send out notification
237*dbd550edSchristosmessages (by mail) whenever partially edited files are preserved during a
238*dbd550edSchristosserial line hangup or system crash, then you should get the BSD sendmail
239*dbd550edSchristossources (via ftp from ftp.cs.berkeley.edu), build and install sendmail, and
240*dbd550edSchristosthen reconfigure, rebuild, and reinstall nvi.
241*dbd550edSchristos
242*dbd550edSchristosPlease contact me at the E-mail address below if you experience any problems in
243*dbd550edSchristosbuilding or using nvi on LynxOS.  I make no guarrantees, but I may be willing
244*dbd550edSchristosto try to help.
245*dbd550edSchristos
246*dbd550edSchristosRon Guilmette
247*dbd550edSchristosRoseville, California
248*dbd550edSchristos<rfg@monkeys.com>
249*dbd550edSchristosAugust 14, 1996
250*dbd550edSchristos
251*dbd550edSchristos
252*dbd550edSchristoscut here for LynxOS 2.4.0 system include files patches
253*dbd550edSchristos-----------------------------------------------------------------------------
254*dbd550edSchristos*** wait.h	Fri Apr 26 10:02:45 1996
255*dbd550edSchristos--- wait.h	Sun May 19 05:36:50 1996
256*dbd550edSchristos***************
257*dbd550edSchristos*** 94,104 ****
258*dbd550edSchristos  /* Function prototypes */
259*dbd550edSchristos  #ifndef __LYNXOS
260*dbd550edSchristos- #ifdef _POSIX_SOURCE
261*dbd550edSchristos  extern pid_t wait		_AP((int *));
262*dbd550edSchristos  extern pid_t waitpid	_AP((pid_t, int *, int));
263*dbd550edSchristos! #else
264*dbd550edSchristos! extern int wait		_AP((union wait *));
265*dbd550edSchristos! extern int waitpid	_AP((int, union wait *, int));
266*dbd550edSchristos! extern int wait3	_AP((union wait *, int, struct rusage *));
267*dbd550edSchristos  #endif
268*dbd550edSchristos  #endif /* !__LYNXOS */
269*dbd550edSchristos--- 94,101 ----
270*dbd550edSchristos  /* Function prototypes */
271*dbd550edSchristos  #ifndef __LYNXOS
272*dbd550edSchristos  extern pid_t wait		_AP((int *));
273*dbd550edSchristos  extern pid_t waitpid	_AP((pid_t, int *, int));
274*dbd550edSchristos! #ifndef _POSIX_SOURCE
275*dbd550edSchristos! extern int wait3	_AP((int *, int, struct rusage *));
276*dbd550edSchristos  #endif
277*dbd550edSchristos  #endif /* !__LYNXOS */
278*dbd550edSchristos*** ioctl.h	Fri Apr 26 16:50:51 1996
279*dbd550edSchristos--- ioctl.h	Sat May 18 17:55:16 1996
280*dbd550edSchristos***************
281*dbd550edSchristos*** 572,576 ****
282*dbd550edSchristos
283*dbd550edSchristos  #ifndef __LYNXOS
284*dbd550edSchristos! extern int ioctl	_AP((int, int, char *));
285*dbd550edSchristos  #endif
286*dbd550edSchristos
287*dbd550edSchristos--- 572,576 ----
288*dbd550edSchristos
289*dbd550edSchristos  #ifndef __LYNXOS
290*dbd550edSchristos! extern int ioctl	_AP((int, int, ...));
291*dbd550edSchristos  #endif
292*dbd550edSchristos
293*dbd550edSchristos*** stdarg.h	Fri Apr 26 16:51:02 1996
294*dbd550edSchristos--- stdarg.h	Sat May 18 19:34:13 1996
295*dbd550edSchristos***************
296*dbd550edSchristos*** 88,92 ****
297*dbd550edSchristos  	(((sizeof(TYPE) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
298*dbd550edSchristos
299*dbd550edSchristos! #define va_start(AP, LASTARG)	(AP = ((char *) __builtin_next_arg ()))
300*dbd550edSchristos
301*dbd550edSchristos  void va_end(va_list);		/* Defined in libgcc.a */
302*dbd550edSchristos--- 88,92 ----
303*dbd550edSchristos  	(((sizeof(TYPE) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
304*dbd550edSchristos
305*dbd550edSchristos! #define va_start(AP, LASTARG)	(AP = ((char *) __builtin_next_arg (LASTARG)))
306*dbd550edSchristos
307*dbd550edSchristos  void va_end(va_list);		/* Defined in libgcc.a */
308*dbd550edSchristos***************
309*dbd550edSchristos*** 162,166 ****
310*dbd550edSchristos  	(((sizeof(TYPE) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
311*dbd550edSchristos
312*dbd550edSchristos! #define va_start(AP, LASTARG)	(AP = ((char *) __builtin_next_arg ()))
313*dbd550edSchristos
314*dbd550edSchristos  void va_end(va_list);		/* Defined in libgcc.a */
315*dbd550edSchristos--- 162,166 ----
316*dbd550edSchristos  	(((sizeof(TYPE) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
317*dbd550edSchristos
318*dbd550edSchristos! #define va_start(AP, LASTARG)	(AP = ((char *) __builtin_next_arg (LASTARG)))
319*dbd550edSchristos
320*dbd550edSchristos  void va_end(va_list);		/* Defined in libgcc.a */
321