1# @(#)README 8.26 (Berkeley) 10/19/96 2 3Nvi uses the GNU autoconf program for configuration and compilation. You 4should enter: 5 6 configure 7 make 8 9and nvi will configure the system and build one or two binaries: nvi and 10tknvi. You can use any path to the configure script, e.g., to build for 11an x86 architecture, I suggest that you do: 12 13 mkdir build.x86 14 cd build.x86 15 ../build/configure 16 make 17 18There are options that you can specify to the configure command. See 19the next section for a description of these options. 20 21If you want to rebuild or reconfigure nvi, for example, because you change 22your mind as to the curses library that you want to use, create a new 23directory and reconfigure it using "configure" and whatever options you 24choose, don't try to selectively edit the files. 25 26By default, nvi is installed as "vi", with hard links to "ex" and "view". 27To install them using different names, use the configure program options. 28For example, to install them as "nvi", "nex" and "nview", use: 29 30 configure --program-prefix=n 31 32See the section below on installation for details. 33 34Note, if you're building nvi on a LynxOS system, you should read the 35README.LynxOS file in this directory for additional build instructions 36that are specific to that operating system. 37 38If you have trouble with this procedure, send email to the addresses 39listed in ../README. In that email, please provide a complete script 40of the output for all of the above commands that you entered. 41 42=-=-=-=-=-=-= 43NVI'S OPTIONS TO THE CONFIGURE PROGRAM 44=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 45 46There are many options that you can enter to the configuration program. 47To see a complete list of the options, enter "configure --help". Only 48a few of them are nvi specific. These options are as follows: 49 50 --disable-curses DON'T use the nvi-provided curses routines. 51 --disable-db DON'T use the nvi-provided DB routines. 52 --disable-re DON'T use the nvi-provided RE routines. 53 --enable-debug Build a debugging version. 54 --enable-perlinterp Include a Perl interpreter in vi. 55 --enable-tclinterp Include a Tk/Tcl interpreter in vi. 56 --enable-tknvi Build a Tk/Tcl front-end for vi. 57 58disable-curses: 59 By default, nvi loads its own implementation of the curses 60 routines (which are a stripped-down version of the 4.4BSD curses 61 library). If you have your own curses library implementation and 62 you want to use it instead, enter: 63 64 --disable-curses 65 66 as an argument to configure, and the curses routines will be taken 67 from whatever libraries you load. Note: System V based curses 68 implementations are usually broken. See the last section of this 69 README for further information about nvi and the curses library. 70 71disable-db: 72 By default, nvi loads its own versions of the Berkeley DB routines 73 (which are a stripped-down version of DB 1.85). If you have your 74 own version of the Berkeley DB routines and you want to use them 75 instead, enter: 76 77 --disable-db 78 79 as an argument to configure, and the DB routines will be taken 80 from whatever libraries you load. Make sure that the DB routines 81 you use are at least version 1.85 or later. 82 83disable-re: 84 By default, nvi loads its own versions of the POSIX 1003.2 Regular 85 Expression routines (which are Henry Spencer's implementation). 86 If your C library contains an implementation of the POSIX 1003.2 87 RE routines (note, this is NOT the same as the historic UNIX RE 88 routines), and you want to use them instead, enter: 89 90 --disable-re 91 92 as an argument to configure, and the RE routines will be taken 93 from whatever libraries you load. Please ensure that your RE 94 routines implement Henry Spencer's extensions for doing vi-style 95 "word" searches. 96 97enable-debug: 98 If you want to build nvi with no optimization (i.e. without -O 99 as a compiler flag), with -g as a compiler flag, and with DEBUG 100 defined during compilation, enter: 101 102 --enable-debug 103 104 as an argument to configure. 105 106enable-perlinterp: 107 If you have the Perl 5 libraries and you want to compile in the 108 Perl interpreter, enter: 109 110 --enable-perlinterp 111 112 as an argument to configure. (Note: this is NOT possible with 113 Perl 4, or even with Perl 5 versions earlier than 5.002.) 114 115enable-tclinterp: 116 If you have the Tk/Tcl libraries and you want to compile in the 117 Tcl/Tk interpreter, enter: 118 119 --enable-tclinterp 120 121 as an argument to configure. If your Tk/Tcl 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. 124 125enable-tknvi: 126 If you have the Tk/Tcl libraries and you want to build the Tcl/Tk 127 nvi front-end, enter: 128 129 --enable-tknvi 130 131 as an argument to configure. If your Tk/Tcl include files and 132 libraries aren't in the standard library and include locations, 133 see the next section of this README file for more information. 134 135=-=-=-=-=-=-= 136ADDING OR CHANGING COMPILERS, OR COMPILE OR LOAD LINE FLAGS 137=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 138 139If you want to use a specific compiler, specify the CC environment 140variable before running configure. For example: 141 142 env CC=gcc configure 143 144Using anything other than the native compiler will almost certainly 145mean that you'll want to check the compile and load line flags, too. 146 147If you want to specify additional load line flags, specify the ADDLDFLAGS 148environment variable before running configure. For example: 149 150 env ADDLDFLAGS="-Q" configure 151 152would specify the -Q flag in the load line when the nvi programs are 153loaded. 154 155If you don't want configure to use the default load line flags for the 156system, specify the LDFLAGS environment variable before running configure. 157For example: 158 159 env LDFLAGS="-32" configure 160 161will cause configure to set the load line flags to "-32", and not set 162them based on the current system. 163 164If you want to specify additional compile line flags, specify the 165ADDCPPFLAGS environment variable before running configure. For example: 166 167 env ADDCPPFLAGS="-I../foo" configure 168 169would cause the compiler to be passed the -I../foo flag when compiling 170test programs during configuration as well as when building nvi object 171files. 172 173If you don't want configure to use the default compile line flags for the 174system, specify the CPPFLAGS environment variable before running configure. 175For example: 176 177 env CPPFLAGS="-I.." configure 178 179will cause configure to use "-I.." as the compile line flags instead of 180the default values. 181 182=-=-=-=-=-=-= 183ADDING LIBRARIES AND INCLUDE FILES 184=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 185 186If the Tk/Tcl or any other include files or libraries are in non-standard 187places on your system, you will need to specify the directory path where 188they can be found. 189 190If you want to specify additional library paths, set the ADDLIBS environment 191variable before running configure. For example: 192 193 env ADDLIBS="-L/a/b -L/e/f -ldb" configure 194 195would specify two additional directories to search for libraries, /a/b 196and /e/f, and one additional library to load, "db". 197 198If you want to specify additional include paths, specify the ADDCPPFLAGS 199environment variable before running configure. For example: 200 201 env ADDCPPFLAGS="-I/usr/local/include" LIBS="-ldb" configure 202 203would search /usr/local/include for include files, as well as load the db 204library as described above. 205 206As a final example, let's say that you've downloaded ncurses from the net 207and you've built it in a directory named ncurses which is at the same 208level in the filesystem hierarchy as nvi. You would enter something like: 209 210 env ADDCPPFLAGS="-I../../ncurses/include" \ 211 ADDLIBS="-L../../ncurses/libraries" configure 212 213to cause nvi to look for the curses include files and the curses library 214in the ncurses environment. 215 216Notes: 217 Make sure that you prepend -L to any library directory names, and 218 that you prepend -I to any include file directory names! Also, 219 make sure that you quote the paths as shown above, i.e. with 220 single or double quotes around the values you're specifying for 221 ADDCPPFLAGS and ADDLIBS. 222 223 =-=-=-=-=-= 224 You should NOT need to add any libraries or include files to load 225 the Perl5 interpreter. The configure script will obtain that 226 information directly from the Perl5 program. This means that the 227 configure script must be able to find perl in its path. It looks 228 for "perl5" first, and then "perl". If you're building a Perl 229 interpreter and neither is found, it's a fatal error. 230 231 =-=-=-=-=-= 232 You do not need to specify additional libraries to load Tk/Tcl, 233 Perl or curses, as the nvi configuration script adds the 234 appropriate libraries to the load line whenever you specify 235 --enable-tknvi or other Perl or Tk/Tcl related option, or build 236 the Tk/Tcl or curses version of nvi. The library names that are 237 automatically loaded are as follows: 238 239 for Perl: -lperl 240 for Tk/Tcl: -ltk -ltcl -lm 241 for curses: -lcurses 242 243 In addition, the configure script loads: 244 245 ... the X libraries when loading the Tk/Tcl libraries, 246 if they exist. 247 248 ... the -ltermcap or -ltermlib libraries when loading 249 any curses library, if they exist. 250 251 =-=-=-=-=-= 252 The env command is available on most systems, and simply sets one 253 or more environment variables before running a command. If the 254 env command is not available to you, you can set the environment 255 variables in your shell before running configure. For example, 256 in sh or ksh, you could do: 257 258 ADDLIBS="-L/a/b -L/e/f -ldb" configure 259 260 and in csh or tcsh, you could do: 261 262 setenv ADDLIBS "-L/a/b -L/e/f -ldb" 263 configure 264 265 See your shell manual page for further information. 266 267=-=-=-=-=-=-= 268INSTALLING NVI 269=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 270 271Nvi installs the following files into the following locations, with 272the following default values: 273 274Variables: Default value: 275prefix /usr/local 276exec_prefix $(prefix) 277bindir $(prefix)/bin 278datadir $(prefix)/share 279mandir $(prefix)/man 280 281File(s): Default location 282---------------------------------------- 283vi $(bindir)/vi 284vi.1 $(mandir)/man1/vi.1 285vi.0 $(mandir)/cat1/vi.0 286Perl scripts $(datadir)/vi/perl/ 287Tcl scripts $(datadir)/vi/tcl/ 288Message Catalogs $(datadir)/vi/catalog/ 289 290Notes: 291 There are two hard links to the vi program, named ex and view. 292 Similarly, there are two hard links to the unformatted vi manual 293 page, named ex.1 and view.1, and two hard links to the formatted 294 manual page, named ex.0 and view.0. These links are created when 295 the program and man pages are installed. 296 297 If you want to install vi, ex, view and the man pages as nvi, nex, 298 nview, use the configure option --program-prefix=n. Other, more 299 complex transformations are possible -- use configure --help to 300 see more options. 301 302 To move the entire installation tree somewhere besides /usr/local, 303 change the value of both "exec_prefix" and "prefix". To move the 304 binaries to a different place, change the value of "bindir". 305 Similarly, to put the datafiles (the message catalogs, Perl and 306 Tcl scripts) or the man pages in a different place, change the 307 value of "datadir" or "mandir". These values can be changed as 308 part of configuration: 309 310 configure --exec_prefix=/usr/contrib --prefix=/usr/share 311 312 or when doing the install itself: 313 314 make exec_prefix=/usr/contrib prefix=/usr/contrib install 315 316 The datafile directory (e.g., /usr/local/share/vi by default) is 317 completely removed and then recreated as part of the installation 318 process. 319 320=-=-=-=-=-=-= 321NVI AND THE CURSES LIBRARY 322=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 323 324The major portability problem for nvi is selecting a curses library. 325Unfortunately, it is common to find broken versions of curses -- the 326original System V curses was broken, resulting in all vendors whose 327implementations are derived from System V having broken implementations 328in turn. 329 330For this reason, BY DEFAULT, nvi uses the stripped-down curses library 331that's included in its distribution. Of course, it would be preferable 332to use the vendor's curses library, or one of the newer implementations 333of curses, e.g., ncurses. 334 335To use the vendor's curses library, specify the: 336 337 --disable-curses 338 339argument to the configure command. If you use the vendor's or other 340curses library, and you see any of the following symptoms: 341 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. 347 348you have a broken curses implementation, and you should reconfigure nvi 349to use another curses library or the curses library provided with nvi. 350 351There are two alternative sources for curses libraries: 352 353#1: Compile the 4BSD curses library from any of the recent BSD 354 releases: FreeBSD, NetBSD or 4.4BSD-Lite release 2. These 355 libraries should be able to support nvi. 356 357#2: Retrieve and build the ncurses library. This library is not 358 recommended unreservedly, at least for now, for two reasons. 359 First, it can't be built on any system where the compiler 360 doesn't support function prototypes. Second, it currently has 361 a few bugs in its support for nvi. It mostly works, but it's 362 still not quite right. 363 364One final note. If you see the following symptoms: 365 366 + Line-by-line screen repainting instead of scrolling. 367 368it usually means that your termcap or terminfo information is insufficient 369for the terminal. 370