xref: /netbsd-src/external/bsd/nvi/dist/build.unix/README (revision dbd550ed1a6686d6600f748306f9cc03d8cd4c94)
1*dbd550edSchristos#	Id: README,v 8.29 2001/05/13 20:52:36 skimo Exp  (Berkeley) Date: 2001/05/13 20:52:36
2*dbd550edSchristos
3*dbd550edSchristosNvi uses the GNU autoconf program for configuration and compilation.  You
4*dbd550edSchristosshould enter:
5*dbd550edSchristos
6*dbd550edSchristos	../dist/configure
7*dbd550edSchristos	make
8*dbd550edSchristos
9*dbd550edSchristosand nvi will configure the system and build one or two binaries:  nvi and
10*dbd550edSchristostknvi.  You can use any path to the configure script, e.g., to build for
11*dbd550edSchristosan x86 architecture, I suggest that you do:
12*dbd550edSchristos
13*dbd550edSchristos	mkdir build.x86
14*dbd550edSchristos	cd build.x86
15*dbd550edSchristos	../dist/configure
16*dbd550edSchristos	make
17*dbd550edSchristos
18*dbd550edSchristosThere are options that you can specify to the configure command.  See
19*dbd550edSchristosthe next section for a description of these options.
20*dbd550edSchristos
21*dbd550edSchristosIf you want to rebuild or reconfigure nvi, for example, because you change
22*dbd550edSchristosyour mind as to the curses library that you want to use, create a new
23*dbd550edSchristosdirectory and reconfigure it using "configure" and whatever options you
24*dbd550edSchristoschoose, don't try to selectively edit the files.
25*dbd550edSchristos
26*dbd550edSchristosBy default, nvi is installed as "vi", with hard links to "ex" and "view".
27*dbd550edSchristosTo install them using different names, use the configure program options.
28*dbd550edSchristosFor example, to install them as "nvi", "nex" and "nview", use:
29*dbd550edSchristos
30*dbd550edSchristos	configure --program-prefix=n
31*dbd550edSchristos
32*dbd550edSchristosSee the section below on installation for details.
33*dbd550edSchristos
34*dbd550edSchristosNote, if you're building nvi on a LynxOS system, you should read the
35*dbd550edSchristosREADME.LynxOS file in this directory for additional build instructions
36*dbd550edSchristosthat are specific to that operating system.
37*dbd550edSchristos
38*dbd550edSchristosIf you have trouble with this procedure, send email to the addresses
39*dbd550edSchristoslisted in ../README.  In that email, please provide a complete script
40*dbd550edSchristosof the output for all of the above commands that you entered.
41*dbd550edSchristos
42*dbd550edSchristos=-=-=-=-=-=-=
43*dbd550edSchristosNVI'S OPTIONS TO THE CONFIGURE PROGRAM
44*dbd550edSchristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
45*dbd550edSchristos
46*dbd550edSchristosThere are many options that you can enter to the configuration program.
47*dbd550edSchristosTo see a complete list of the options, enter "configure --help".  Only
48*dbd550edSchristosa few of them are nvi specific.  These options are as follows:
49*dbd550edSchristos
50*dbd550edSchristos  --disable-re            DON'T use the nvi-provided RE routines.
51*dbd550edSchristos  --enable-debug          Build a debugging version.
52*dbd550edSchristos  --enable-perlinterp     Include a Perl interpreter in vi.
53*dbd550edSchristos  --enable-tclinterp      Include a Tk/Tcl interpreter in vi.
54*dbd550edSchristos  --enable-gtk		  Build a gtk front-end.
55*dbd550edSchristos  --enable-motif	  Build a motif front-end.
56*dbd550edSchristos  --enable-threads	  Turn on thread support.
57*dbd550edSchristos  --enable-widechar	  Build a wide character aware vi (experimental).
58*dbd550edSchristos  --with-curses=DIR       Path to curses installation.
59*dbd550edSchristos  --with-db3=db3prefix    Path to db3 installation.
60*dbd550edSchristos  --enable-dynamic-loading Load DB 3 dynamically.
61*dbd550edSchristos
62*dbd550edSchristosdisable-re:
63*dbd550edSchristos	By default, nvi loads its own versions of the POSIX 1003.2 Regular
64*dbd550edSchristos	Expression routines (which are Henry Spencer's implementation).
65*dbd550edSchristos	If your C library contains an implementation of the POSIX 1003.2
66*dbd550edSchristos	RE routines (note, this is NOT the same as the historic UNIX RE
67*dbd550edSchristos	routines), and you want to use them instead, enter:
68*dbd550edSchristos
69*dbd550edSchristos	--disable-re
70*dbd550edSchristos
71*dbd550edSchristos	as an argument to configure, and the RE routines will be taken
72*dbd550edSchristos	from whatever libraries you load.  Please ensure that your RE
73*dbd550edSchristos	routines implement Henry Spencer's extensions for doing vi-style
74*dbd550edSchristos	"word" searches.
75*dbd550edSchristos
76*dbd550edSchristosenable-debug:
77*dbd550edSchristos	If you want to build nvi with no optimization (i.e. without -O
78*dbd550edSchristos	as a compiler flag), with -g as a compiler flag, and with DEBUG
79*dbd550edSchristos	defined during compilation, enter:
80*dbd550edSchristos
81*dbd550edSchristos	--enable-debug
82*dbd550edSchristos
83*dbd550edSchristos	as an argument to configure.
84*dbd550edSchristos
85*dbd550edSchristosenable-perlinterp:
86*dbd550edSchristos	If you have the Perl 5 libraries and you want to compile in the
87*dbd550edSchristos	Perl interpreter, enter:
88*dbd550edSchristos
89*dbd550edSchristos	--enable-perlinterp
90*dbd550edSchristos
91*dbd550edSchristos	as an argument to configure.  (Note: this is NOT possible with
92*dbd550edSchristos	Perl 4, or even with Perl 5 versions earlier than 5.002.)
93*dbd550edSchristos
94*dbd550edSchristosenable-tclinterp:
95*dbd550edSchristos	If you have the Tk/Tcl libraries and you want to compile in the
96*dbd550edSchristos	Tcl/Tk interpreter, enter:
97*dbd550edSchristos
98*dbd550edSchristos	--enable-tclinterp
99*dbd550edSchristos
100*dbd550edSchristos	as an argument to configure.  If your Tk/Tcl include files and
101*dbd550edSchristos	libraries aren't in the standard library and include locations,
102*dbd550edSchristos	see the next section of this README file for more information.
103*dbd550edSchristos
104*dbd550edSchristosenable-gtk:
105*dbd550edSchristos	If you have the Gtk libraries and you want to build the Gtk
106*dbd550edSchristos	nvi front-end, enter:
107*dbd550edSchristos
108*dbd550edSchristos	--enable-gtk
109*dbd550edSchristos
110*dbd550edSchristos	as an argument to configure.  If your Gtk include files and
111*dbd550edSchristos	libraries aren't in the standard library and include locations,
112*dbd550edSchristos	see the next section of this README file for more information.
113*dbd550edSchristos	See also the enable-threads option.
114*dbd550edSchristos
115*dbd550edSchristosenable-motif:
116*dbd550edSchristos	If you have the Motif libraries and you want to build the Motif
117*dbd550edSchristos	nvi front-end, enter:
118*dbd550edSchristos
119*dbd550edSchristos	--enable-motif
120*dbd550edSchristos
121*dbd550edSchristos	as an argument to configure.  If your Motif include files and
122*dbd550edSchristos	libraries aren't in the standard library and include locations,
123*dbd550edSchristos	see the next section of this README file for more information.
124*dbd550edSchristos
125*dbd550edSchristosenable-threads:
126*dbd550edSchristos	If you want to be able to use multiple windows in the Gtk
127*dbd550edSchristos	front-end, you should specify this option.
128*dbd550edSchristos
129*dbd550edSchristoswith-curses:
130*dbd550edSchristos	Specifies the path where curses is installed.
131*dbd550edSchristos
132*dbd550edSchristoswith-db3:
133*dbd550edSchristos	Specifies the path where DB3 is installed.
134*dbd550edSchristos	See README.DB3 for more information about DB3.
135*dbd550edSchristos
136*dbd550edSchristosenable-dynamic-loading:
137*dbd550edSchristos	Dynamically load DB3 library.
138*dbd550edSchristos	See README.DB3 for more information about DB3.
139*dbd550edSchristos
140*dbd550edSchristosenable-widechar:
141*dbd550edSchristos	Enables support for wide characters.
142*dbd550edSchristos	Note that this is still rather experimental.
143*dbd550edSchristos
144*dbd550edSchristos	If you try this out on Solaris, you will want to point nvi
145*dbd550edSchristos	to the curses in /usr/xpg4/ which is CSI compliant.
146*dbd550edSchristos
147*dbd550edSchristos=-=-=-=-=-=-=
148*dbd550edSchristosADDING OR CHANGING COMPILERS, OR COMPILE OR LOAD LINE FLAGS
149*dbd550edSchristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
150*dbd550edSchristos
151*dbd550edSchristosIf you want to use a specific compiler, specify the CC environment
152*dbd550edSchristosvariable before running configure.  For example:
153*dbd550edSchristos
154*dbd550edSchristos	env CC=gcc configure
155*dbd550edSchristos
156*dbd550edSchristosUsing anything other than the native compiler will almost certainly
157*dbd550edSchristosmean that you'll want to check the compile and load line flags, too.
158*dbd550edSchristos
159*dbd550edSchristosIf you want to specify additional load line flags, specify the ADDLDFLAGS
160*dbd550edSchristosenvironment variable before running configure.  For example:
161*dbd550edSchristos
162*dbd550edSchristos	env ADDLDFLAGS="-Q" configure
163*dbd550edSchristos
164*dbd550edSchristoswould specify the -Q flag in the load line when the nvi programs are
165*dbd550edSchristosloaded.
166*dbd550edSchristos
167*dbd550edSchristosIf you don't want configure to use the default load line flags for the
168*dbd550edSchristossystem, specify the LDFLAGS environment variable before running configure.
169*dbd550edSchristosFor example:
170*dbd550edSchristos
171*dbd550edSchristos	env LDFLAGS="-32" configure
172*dbd550edSchristos
173*dbd550edSchristoswill cause configure to set the load line flags to "-32", and not set
174*dbd550edSchristosthem based on the current system.
175*dbd550edSchristos
176*dbd550edSchristosIf you want to specify additional compile line flags, specify the
177*dbd550edSchristosADDCPPFLAGS environment variable before running configure.  For example:
178*dbd550edSchristos
179*dbd550edSchristos	env ADDCPPFLAGS="-I../foo" configure
180*dbd550edSchristos
181*dbd550edSchristoswould cause the compiler to be passed the -I../foo flag when compiling
182*dbd550edSchristostest programs during configuration as well as when building nvi object
183*dbd550edSchristosfiles.
184*dbd550edSchristos
185*dbd550edSchristosIf you don't want configure to use the default compile line flags for the
186*dbd550edSchristossystem, specify the CPPFLAGS environment variable before running configure.
187*dbd550edSchristosFor example:
188*dbd550edSchristos
189*dbd550edSchristos	env CPPFLAGS="-I.." configure
190*dbd550edSchristos
191*dbd550edSchristoswill cause configure to use "-I.." as the compile line flags instead of
192*dbd550edSchristosthe default values.
193*dbd550edSchristos
194*dbd550edSchristos=-=-=-=-=-=-=
195*dbd550edSchristosADDING LIBRARIES AND INCLUDE FILES
196*dbd550edSchristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
197*dbd550edSchristos
198*dbd550edSchristosIf the Tk/Tcl or any other include files or libraries are in non-standard
199*dbd550edSchristosplaces on your system, you will need to specify the directory path where
200*dbd550edSchristosthey can be found.
201*dbd550edSchristos
202*dbd550edSchristosIf you want to specify additional library paths, set the ADDLIBS environment
203*dbd550edSchristosvariable before running configure.  For example:
204*dbd550edSchristos
205*dbd550edSchristos	env ADDLIBS="-L/a/b -L/e/f -ldb" configure
206*dbd550edSchristos
207*dbd550edSchristoswould specify two additional directories to search for libraries, /a/b
208*dbd550edSchristosand /e/f, and one additional library to load, "db".
209*dbd550edSchristos
210*dbd550edSchristosIf you want to specify additional include paths, specify the ADDCPPFLAGS
211*dbd550edSchristosenvironment variable before running configure.  For example:
212*dbd550edSchristos
213*dbd550edSchristos	env ADDCPPFLAGS="-I/usr/local/include" LIBS="-ldb" configure
214*dbd550edSchristos
215*dbd550edSchristoswould search /usr/local/include for include files, as well as load the db
216*dbd550edSchristoslibrary as described above.
217*dbd550edSchristos
218*dbd550edSchristosAs a final example, let's say that you've downloaded ncurses from the net
219*dbd550edSchristosand you've built it in a directory named ncurses which is at the same
220*dbd550edSchristoslevel in the filesystem hierarchy as nvi.  You would enter something like:
221*dbd550edSchristos
222*dbd550edSchristos	env ADDCPPFLAGS="-I../../ncurses/include" \
223*dbd550edSchristos	    ADDLIBS="-L../../ncurses/libraries" configure
224*dbd550edSchristos
225*dbd550edSchristosto cause nvi to look for the curses include files and the curses library
226*dbd550edSchristosin the ncurses environment.
227*dbd550edSchristos
228*dbd550edSchristosNotes:
229*dbd550edSchristos	Make sure that you prepend -L to any library directory names, and
230*dbd550edSchristos	that you prepend -I to any include file directory names!  Also,
231*dbd550edSchristos	make sure that you quote the paths as shown above, i.e. with
232*dbd550edSchristos	single or double quotes around the values you're specifying for
233*dbd550edSchristos	ADDCPPFLAGS and ADDLIBS.
234*dbd550edSchristos
235*dbd550edSchristos	=-=-=-=-=-=
236*dbd550edSchristos	You should NOT need to add any libraries or include files to load
237*dbd550edSchristos	the Perl5 interpreter.  The configure script will obtain that
238*dbd550edSchristos	information directly from the Perl5 program.  This means that the
239*dbd550edSchristos	configure script must be able to find perl in its path.  It looks
240*dbd550edSchristos	for "perl5" first, and then "perl".  If you're building a Perl
241*dbd550edSchristos	interpreter and neither is found, it's a fatal error.
242*dbd550edSchristos
243*dbd550edSchristos	=-=-=-=-=-=
244*dbd550edSchristos	You do not need to specify additional libraries to load Tk/Tcl,
245*dbd550edSchristos	Perl or curses, as the nvi configuration script adds the
246*dbd550edSchristos	appropriate libraries to the load line whenever you specify
247*dbd550edSchristos	--enable-tknvi or other Perl or Tk/Tcl related option, or build
248*dbd550edSchristos	the Tk/Tcl or curses version of nvi.  The library names that are
249*dbd550edSchristos	automatically loaded are as follows:
250*dbd550edSchristos
251*dbd550edSchristos	for Perl:	-lperl
252*dbd550edSchristos	for Tk/Tcl:	-ltk -ltcl -lm
253*dbd550edSchristos	for curses:	-lcurses
254*dbd550edSchristos
255*dbd550edSchristos	In addition, the configure script loads:
256*dbd550edSchristos
257*dbd550edSchristos		... the X libraries when loading the Tk/Tcl libraries,
258*dbd550edSchristos		    if they exist.
259*dbd550edSchristos
260*dbd550edSchristos		... the -ltermcap or -ltermlib libraries when loading
261*dbd550edSchristos		    any curses library, if they exist.
262*dbd550edSchristos
263*dbd550edSchristos	=-=-=-=-=-=
264*dbd550edSchristos	The env command is available on most systems, and simply sets one
265*dbd550edSchristos	or more environment variables before running a command.  If the
266*dbd550edSchristos	env command is not available to you, you can set the environment
267*dbd550edSchristos	variables in your shell before running configure.  For example,
268*dbd550edSchristos	in sh or ksh, you could do:
269*dbd550edSchristos
270*dbd550edSchristos		ADDLIBS="-L/a/b -L/e/f -ldb" configure
271*dbd550edSchristos
272*dbd550edSchristos	and in csh or tcsh, you could do:
273*dbd550edSchristos
274*dbd550edSchristos		setenv ADDLIBS "-L/a/b -L/e/f -ldb"
275*dbd550edSchristos		configure
276*dbd550edSchristos
277*dbd550edSchristos	See your shell manual page for further information.
278*dbd550edSchristos
279*dbd550edSchristos=-=-=-=-=-=-=
280*dbd550edSchristosINSTALLING NVI
281*dbd550edSchristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
282*dbd550edSchristos
283*dbd550edSchristosNvi installs the following files into the following locations, with
284*dbd550edSchristosthe following default values:
285*dbd550edSchristos
286*dbd550edSchristosVariables:		Default value:
287*dbd550edSchristosprefix			/usr/local
288*dbd550edSchristosexec_prefix		$(prefix)
289*dbd550edSchristosbindir			$(prefix)/bin
290*dbd550edSchristosdatadir			$(prefix)/share
291*dbd550edSchristosmandir			$(prefix)/man
292*dbd550edSchristos
293*dbd550edSchristosFile(s):		Default location
294*dbd550edSchristos----------------------------------------
295*dbd550edSchristosvi			$(bindir)/vi
296*dbd550edSchristosvi.1			$(mandir)/man1/vi.1
297*dbd550edSchristosvi.0			$(mandir)/cat1/vi.0
298*dbd550edSchristosPerl scripts		$(datadir)/vi/perl/
299*dbd550edSchristosTcl scripts		$(datadir)/vi/tcl/
300*dbd550edSchristosMessage Catalogs	$(datadir)/vi/catalog/
301*dbd550edSchristos
302*dbd550edSchristosNotes:
303*dbd550edSchristos	There are two hard links to the vi program, named ex and view.
304*dbd550edSchristos	Similarly, there are two hard links to the unformatted vi manual
305*dbd550edSchristos	page, named ex.1 and view.1, and two hard links to the formatted
306*dbd550edSchristos	manual page, named ex.0 and view.0.  These links are created when
307*dbd550edSchristos	the program and man pages are installed.
308*dbd550edSchristos
309*dbd550edSchristos	If you want to install vi, ex, view and the man pages as nvi, nex,
310*dbd550edSchristos	nview, use the configure option --program-prefix=n.  Other, more
311*dbd550edSchristos	complex transformations are possible -- use configure --help to
312*dbd550edSchristos	see more options.
313*dbd550edSchristos
314*dbd550edSchristos	To move the entire installation tree somewhere besides /usr/local,
315*dbd550edSchristos	change the value of both "exec_prefix" and "prefix".  To move the
316*dbd550edSchristos	binaries to a different place, change the value of "bindir".
317*dbd550edSchristos	Similarly, to put the datafiles (the message catalogs, Perl and
318*dbd550edSchristos	Tcl scripts) or the man pages in a different place, change the
319*dbd550edSchristos	value of "datadir" or "mandir".  These values can be changed as
320*dbd550edSchristos	part of configuration:
321*dbd550edSchristos
322*dbd550edSchristos		configure --exec_prefix=/usr/contrib --prefix=/usr/share
323*dbd550edSchristos
324*dbd550edSchristos	or when doing the install itself:
325*dbd550edSchristos
326*dbd550edSchristos		make exec_prefix=/usr/contrib prefix=/usr/contrib install
327*dbd550edSchristos
328*dbd550edSchristos	The datafile directory (e.g., /usr/local/share/vi by default) is
329*dbd550edSchristos	completely removed and then recreated as part of the installation
330*dbd550edSchristos	process.
331*dbd550edSchristos
332*dbd550edSchristos=-=-=-=-=-=-=
333*dbd550edSchristosNVI AND THE CURSES LIBRARY
334*dbd550edSchristos=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
335*dbd550edSchristos
336*dbd550edSchristosThe major portability problem for nvi is selecting a curses library.
337*dbd550edSchristosUnfortunately, it is common to find broken versions of curses -- the
338*dbd550edSchristosoriginal System V curses was broken, resulting in all vendors whose
339*dbd550edSchristosimplementations are derived from System V having broken implementations
340*dbd550edSchristosin turn.
341*dbd550edSchristos
342*dbd550edSchristosIf you use the vendor's or other curses library, and you see any of the
343*dbd550edSchristosfollowing symptoms:
344*dbd550edSchristos
345*dbd550edSchristos	+ Core dumps in curses routines.
346*dbd550edSchristos	+ Missing routines when compiling.
347*dbd550edSchristos	+ Repainting the wrong characters on the screen.
348*dbd550edSchristos	+ Displaying inverse video in the wrong places.
349*dbd550edSchristos	+ Failure to reset your terminal to the correct modes on exit.
350*dbd550edSchristos
351*dbd550edSchristosyou have a broken curses implementation, and you should reconfigure nvi
352*dbd550edSchristosto use another curses library.
353*dbd550edSchristos
354*dbd550edSchristosAn alternative for your vendor's curses is ncurses, available from
355*dbd550edSchristosftp://ftp.gnu.org/pub/gnu/ncurses/
356*dbd550edSchristos
357*dbd550edSchristosOne final note.  If you see the following symptoms:
358*dbd550edSchristos
359*dbd550edSchristos	+ Line-by-line screen repainting instead of scrolling.
360*dbd550edSchristos
361*dbd550edSchristosit usually means that your termcap or terminfo information is insufficient
362*dbd550edSchristosfor the terminal.
363