use iconv for non-codeset fileencodings
[nvi.git] / build.unix / README
blob82dd526d1fb8c004d7c977b07b578e1f978db583
1 #       $Id: README,v 8.28 2001/04/30 09:31:12 skimo Exp $ (Berkeley) $Date: 2001/04/30 09:31:12 $
3 Nvi uses the GNU autoconf program for configuration and compilation.  You
4 should enter:
6         ../dist/configure
7         make
9 and nvi will configure the system and build one or two binaries:  nvi and
10 tknvi.  You can use any path to the configure script, e.g., to build for
11 an x86 architecture, I suggest that you do:
13         mkdir build.x86
14         cd build.x86
15         ../dist/configure
16         make
18 There are options that you can specify to the configure command.  See
19 the next section for a description of these options.
21 If you want to rebuild or reconfigure nvi, for example, because you change
22 your mind as to the curses library that you want to use, create a new
23 directory and reconfigure it using "configure" and whatever options you
24 choose, don't try to selectively edit the files.
26 By default, nvi is installed as "vi", with hard links to "ex" and "view".
27 To install them using different names, use the configure program options.
28 For example, to install them as "nvi", "nex" and "nview", use:
30         configure --program-prefix=n
32 See the section below on installation for details.
34 Note, if you're building nvi on a LynxOS system, you should read the
35 README.LynxOS file in this directory for additional build instructions
36 that are specific to that operating system.
38 If you have trouble with this procedure, send email to the addresses
39 listed in ../README.  In that email, please provide a complete script
40 of the output for all of the above commands that you entered.
42 =-=-=-=-=-=-=
43 NVI'S OPTIONS TO THE CONFIGURE PROGRAM
44 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
46 There are many options that you can enter to the configuration program.
47 To see a complete list of the options, enter "configure --help".  Only
48 a few of them are nvi specific.  These options are as follows:
50   --disable-re            DON'T use the nvi-provided RE routines.
51   --enable-debug          Build a debugging version.
52   --enable-perlinterp     Include a Perl interpreter in vi.
53   --enable-tclinterp      Include a Tk/Tcl interpreter in vi.
54   --enable-gtk            Build a gtk front-end.
55   --enable-motif          Build a motif front-end.
56   --enable-threads        Turn on thread support.
57   --enable-widechar       Build a wide character aware vi (experimental).
58   --with-curses=DIR       Path to curses installation.
59   --with-db3=db3prefix    Path to db3 installation.
60   --enable-dynamic-loading Load DB 3 dynamically.
62 disable-re:
63         By default, nvi loads its own versions of the POSIX 1003.2 Regular
64         Expression routines (which are Henry Spencer's implementation).
65         If your C library contains an implementation of the POSIX 1003.2
66         RE routines (note, this is NOT the same as the historic UNIX RE
67         routines), and you want to use them instead, enter:
69         --disable-re
71         as an argument to configure, and the RE routines will be taken
72         from whatever libraries you load.  Please ensure that your RE
73         routines implement Henry Spencer's extensions for doing vi-style
74         "word" searches.
76 enable-debug:
77         If you want to build nvi with no optimization (i.e. without -O
78         as a compiler flag), with -g as a compiler flag, and with DEBUG
79         defined during compilation, enter:
81         --enable-debug
83         as an argument to configure.
85 enable-perlinterp:
86         If you have the Perl 5 libraries and you want to compile in the
87         Perl interpreter, enter:
89         --enable-perlinterp
91         as an argument to configure.  (Note: this is NOT possible with
92         Perl 4, or even with Perl 5 versions earlier than 5.002.)
94 enable-tclinterp:
95         If you have the Tk/Tcl libraries and you want to compile in the
96         Tcl/Tk interpreter, enter:
98         --enable-tclinterp
100         as an argument to configure.  If your Tk/Tcl include files and
101         libraries aren't in the standard library and include locations,
102         see the next section of this README file for more information.
104 enable-gtk:
105         If you have the Gtk libraries and you want to build the Gtk
106         nvi front-end, enter:
108         --enable-gtk
110         as an argument to configure.  If your Gtk include files and
111         libraries aren't in the standard library and include locations,
112         see the next section of this README file for more information.
113         See also the enable-threads option.
115 enable-motif:
116         If you have the Motif libraries and you want to build the Motif
117         nvi front-end, enter:
119         --enable-motif
121         as an argument to configure.  If your Motif include files and
122         libraries aren't in the standard library and include locations,
123         see the next section of this README file for more information.
125 enable-threads:
126         If you want to be able to use multiple windows in the Gtk
127         front-end, you should specify this option.
129 with-curses:
130         Specifies the path where curses is installed.
132 with-db3:
133         Specifies the path where DB3 is installed.
134         See README.DB3 for more information about DB3.
136 enable-dynamic-loading:
137         Dynamically load DB3 library.
138         See README.DB3 for more information about DB3.
140 enable-widechar:
141         Enables support for wide characters.
142         Note that this is still rather experimental.
144 =-=-=-=-=-=-=
145 ADDING OR CHANGING COMPILERS, OR COMPILE OR LOAD LINE FLAGS
146 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
148 If you want to use a specific compiler, specify the CC environment
149 variable before running configure.  For example:
151         env CC=gcc configure
153 Using anything other than the native compiler will almost certainly
154 mean that you'll want to check the compile and load line flags, too.
156 If you want to specify additional load line flags, specify the ADDLDFLAGS
157 environment variable before running configure.  For example:
159         env ADDLDFLAGS="-Q" configure
161 would specify the -Q flag in the load line when the nvi programs are
162 loaded.
164 If you don't want configure to use the default load line flags for the
165 system, specify the LDFLAGS environment variable before running configure.
166 For example:
168         env LDFLAGS="-32" configure
170 will cause configure to set the load line flags to "-32", and not set
171 them based on the current system.
173 If you want to specify additional compile line flags, specify the
174 ADDCPPFLAGS environment variable before running configure.  For example:
176         env ADDCPPFLAGS="-I../foo" configure
178 would cause the compiler to be passed the -I../foo flag when compiling
179 test programs during configuration as well as when building nvi object
180 files.
182 If you don't want configure to use the default compile line flags for the
183 system, specify the CPPFLAGS environment variable before running configure.
184 For example:
186         env CPPFLAGS="-I.." configure
188 will cause configure to use "-I.." as the compile line flags instead of
189 the default values.
191 =-=-=-=-=-=-=
192 ADDING LIBRARIES AND INCLUDE FILES
193 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
195 If the Tk/Tcl or any other include files or libraries are in non-standard
196 places on your system, you will need to specify the directory path where
197 they can be found.
199 If you want to specify additional library paths, set the ADDLIBS environment
200 variable before running configure.  For example:
202         env ADDLIBS="-L/a/b -L/e/f -ldb" configure
204 would specify two additional directories to search for libraries, /a/b
205 and /e/f, and one additional library to load, "db".
207 If you want to specify additional include paths, specify the ADDCPPFLAGS
208 environment variable before running configure.  For example:
210         env ADDCPPFLAGS="-I/usr/local/include" LIBS="-ldb" configure
212 would search /usr/local/include for include files, as well as load the db
213 library as described above.
215 As a final example, let's say that you've downloaded ncurses from the net
216 and you've built it in a directory named ncurses which is at the same
217 level in the filesystem hierarchy as nvi.  You would enter something like:
219         env ADDCPPFLAGS="-I../../ncurses/include" \
220             ADDLIBS="-L../../ncurses/libraries" configure
222 to cause nvi to look for the curses include files and the curses library
223 in the ncurses environment.
225 Notes:
226         Make sure that you prepend -L to any library directory names, and
227         that you prepend -I to any include file directory names!  Also,
228         make sure that you quote the paths as shown above, i.e. with
229         single or double quotes around the values you're specifying for
230         ADDCPPFLAGS and ADDLIBS.
232         =-=-=-=-=-=
233         You should NOT need to add any libraries or include files to load
234         the Perl5 interpreter.  The configure script will obtain that
235         information directly from the Perl5 program.  This means that the
236         configure script must be able to find perl in its path.  It looks
237         for "perl5" first, and then "perl".  If you're building a Perl
238         interpreter and neither is found, it's a fatal error.
240         =-=-=-=-=-=
241         You do not need to specify additional libraries to load Tk/Tcl,
242         Perl or curses, as the nvi configuration script adds the
243         appropriate libraries to the load line whenever you specify
244         --enable-tknvi or other Perl or Tk/Tcl related option, or build
245         the Tk/Tcl or curses version of nvi.  The library names that are
246         automatically loaded are as follows:
248         for Perl:       -lperl
249         for Tk/Tcl:     -ltk -ltcl -lm
250         for curses:     -lcurses
252         In addition, the configure script loads:
254                 ... the X libraries when loading the Tk/Tcl libraries,
255                     if they exist.
257                 ... the -ltermcap or -ltermlib libraries when loading
258                     any curses library, if they exist.
260         =-=-=-=-=-=
261         The env command is available on most systems, and simply sets one
262         or more environment variables before running a command.  If the
263         env command is not available to you, you can set the environment
264         variables in your shell before running configure.  For example,
265         in sh or ksh, you could do:
267                 ADDLIBS="-L/a/b -L/e/f -ldb" configure
269         and in csh or tcsh, you could do:
271                 setenv ADDLIBS "-L/a/b -L/e/f -ldb"
272                 configure
274         See your shell manual page for further information.
276 =-=-=-=-=-=-=
277 INSTALLING NVI
278 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
280 Nvi installs the following files into the following locations, with
281 the following default values:
283 Variables:              Default value:
284 prefix                  /usr/local
285 exec_prefix             $(prefix)
286 bindir                  $(prefix)/bin
287 datadir                 $(prefix)/share
288 mandir                  $(prefix)/man
290 File(s):                Default location
291 ----------------------------------------
292 vi                      $(bindir)/vi
293 vi.1                    $(mandir)/man1/vi.1
294 vi.0                    $(mandir)/cat1/vi.0
295 Perl scripts            $(datadir)/vi/perl/
296 Tcl scripts             $(datadir)/vi/tcl/
297 Message Catalogs        $(datadir)/vi/catalog/
299 Notes:
300         There are two hard links to the vi program, named ex and view.
301         Similarly, there are two hard links to the unformatted vi manual
302         page, named ex.1 and view.1, and two hard links to the formatted
303         manual page, named ex.0 and view.0.  These links are created when
304         the program and man pages are installed.
306         If you want to install vi, ex, view and the man pages as nvi, nex,
307         nview, use the configure option --program-prefix=n.  Other, more
308         complex transformations are possible -- use configure --help to
309         see more options.
311         To move the entire installation tree somewhere besides /usr/local,
312         change the value of both "exec_prefix" and "prefix".  To move the
313         binaries to a different place, change the value of "bindir".
314         Similarly, to put the datafiles (the message catalogs, Perl and
315         Tcl scripts) or the man pages in a different place, change the
316         value of "datadir" or "mandir".  These values can be changed as
317         part of configuration:
319                 configure --exec_prefix=/usr/contrib --prefix=/usr/share
321         or when doing the install itself:
323                 make exec_prefix=/usr/contrib prefix=/usr/contrib install
325         The datafile directory (e.g., /usr/local/share/vi by default) is
326         completely removed and then recreated as part of the installation
327         process.
329 =-=-=-=-=-=-=
330 NVI AND THE CURSES LIBRARY
331 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
333 The major portability problem for nvi is selecting a curses library.
334 Unfortunately, it is common to find broken versions of curses -- the
335 original System V curses was broken, resulting in all vendors whose
336 implementations are derived from System V having broken implementations
337 in turn.
339 If you use the vendor's or other curses library, and you see any of the
340 following symptoms:
342         + Core dumps in curses routines.
343         + Missing routines when compiling.
344         + Repainting the wrong characters on the screen.
345         + Displaying inverse video in the wrong places.
346         + Failure to reset your terminal to the correct modes on exit.
348 you have a broken curses implementation, and you should reconfigure nvi
349 to use another curses library.
351 An alternative for your vendor's curses is ncurses, available from
352 ftp://ftp.gnu.org/pub/gnu/ncurses/
354 One final note.  If you see the following symptoms:
356         + Line-by-line screen repainting instead of scrolling.
358 it usually means that your termcap or terminfo information is insufficient
359 for the terminal.