119304Speter# @(#)README 8.26 (Berkeley) 10/19/96 219304Speter 319304SpeterNvi uses the GNU autoconf program for configuration and compilation. You 419304Spetershould enter: 519304Speter 619304Speter configure 719304Speter make 819304Speter 919304Speterand nvi will configure the system and build one or two binaries: nvi and 1019304Spetertknvi. You can use any path to the configure script, e.g., to build for 1119304Speteran x86 architecture, I suggest that you do: 1219304Speter 1319304Speter mkdir build.x86 1419304Speter cd build.x86 1519304Speter ../build/configure 1619304Speter make 1719304Speter 1819304SpeterThere are options that you can specify to the configure command. See 1919304Speterthe next section for a description of these options. 2019304Speter 2119304SpeterIf you want to rebuild or reconfigure nvi, for example, because you change 2219304Speteryour mind as to the curses library that you want to use, create a new 2319304Speterdirectory and reconfigure it using "configure" and whatever options you 2419304Speterchoose, don't try to selectively edit the files. 2519304Speter 2619304SpeterBy default, nvi is installed as "vi", with hard links to "ex" and "view". 2719304SpeterTo install them using different names, use the configure program options. 2819304SpeterFor example, to install them as "nvi", "nex" and "nview", use: 2919304Speter 3019304Speter configure --program-prefix=n 3119304Speter 3219304SpeterSee the section below on installation for details. 3319304Speter 3419304SpeterNote, if you're building nvi on a LynxOS system, you should read the 3519304SpeterREADME.LynxOS file in this directory for additional build instructions 3619304Speterthat are specific to that operating system. 3719304Speter 3819304SpeterIf you have trouble with this procedure, send email to the addresses 3919304Speterlisted in ../README. In that email, please provide a complete script 4019304Speterof the output for all of the above commands that you entered. 4119304Speter 4219304Speter=-=-=-=-=-=-= 4319304SpeterNVI'S OPTIONS TO THE CONFIGURE PROGRAM 4419304Speter=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 4519304Speter 4619304SpeterThere are many options that you can enter to the configuration program. 4719304SpeterTo see a complete list of the options, enter "configure --help". Only 4819304Spetera few of them are nvi specific. These options are as follows: 4919304Speter 5019304Speter --disable-curses DON'T use the nvi-provided curses routines. 5119304Speter --disable-db DON'T use the nvi-provided DB routines. 5219304Speter --disable-re DON'T use the nvi-provided RE routines. 5319304Speter --enable-debug Build a debugging version. 5419304Speter --enable-perlinterp Include a Perl interpreter in vi. 5519304Speter --enable-tclinterp Include a Tk/Tcl interpreter in vi. 5619304Speter --enable-tknvi Build a Tk/Tcl front-end for vi. 5719304Speter 5819304Speterdisable-curses: 5919304Speter By default, nvi loads its own implementation of the curses 6019304Speter routines (which are a stripped-down version of the 4.4BSD curses 6119304Speter library). If you have your own curses library implementation and 6219304Speter you want to use it instead, enter: 6319304Speter 6419304Speter --disable-curses 6519304Speter 6619304Speter as an argument to configure, and the curses routines will be taken 6719304Speter from whatever libraries you load. Note: System V based curses 6819304Speter implementations are usually broken. See the last section of this 6919304Speter README for further information about nvi and the curses library. 7019304Speter 7119304Speterdisable-db: 7219304Speter By default, nvi loads its own versions of the Berkeley DB routines 7319304Speter (which are a stripped-down version of DB 1.85). If you have your 7419304Speter own version of the Berkeley DB routines and you want to use them 7519304Speter instead, enter: 7619304Speter 7719304Speter --disable-db 7819304Speter 7919304Speter as an argument to configure, and the DB routines will be taken 8019304Speter from whatever libraries you load. Make sure that the DB routines 8119304Speter you use are at least version 1.85 or later. 8219304Speter 8319304Speterdisable-re: 8419304Speter By default, nvi loads its own versions of the POSIX 1003.2 Regular 8519304Speter Expression routines (which are Henry Spencer's implementation). 8619304Speter If your C library contains an implementation of the POSIX 1003.2 8719304Speter RE routines (note, this is NOT the same as the historic UNIX RE 8819304Speter routines), and you want to use them instead, enter: 8919304Speter 9019304Speter --disable-re 9119304Speter 9219304Speter as an argument to configure, and the RE routines will be taken 9319304Speter from whatever libraries you load. Please ensure that your RE 9419304Speter routines implement Henry Spencer's extensions for doing vi-style 9519304Speter "word" searches. 9619304Speter 9719304Speterenable-debug: 9819304Speter If you want to build nvi with no optimization (i.e. without -O 9919304Speter as a compiler flag), with -g as a compiler flag, and with DEBUG 10019304Speter defined during compilation, enter: 10119304Speter 10219304Speter --enable-debug 10319304Speter 10419304Speter as an argument to configure. 10519304Speter 10619304Speterenable-perlinterp: 10719304Speter If you have the Perl 5 libraries and you want to compile in the 10819304Speter Perl interpreter, enter: 10919304Speter 11019304Speter --enable-perlinterp 11119304Speter 11219304Speter as an argument to configure. (Note: this is NOT possible with 11319304Speter Perl 4, or even with Perl 5 versions earlier than 5.002.) 11419304Speter 11519304Speterenable-tclinterp: 11619304Speter If you have the Tk/Tcl libraries and you want to compile in the 11719304Speter Tcl/Tk interpreter, enter: 11819304Speter 11919304Speter --enable-tclinterp 12019304Speter 12119304Speter as an argument to configure. If your Tk/Tcl include files and 12219304Speter libraries aren't in the standard library and include locations, 12319304Speter see the next section of this README file for more information. 12419304Speter 12519304Speterenable-tknvi: 12619304Speter If you have the Tk/Tcl libraries and you want to build the Tcl/Tk 12719304Speter nvi front-end, enter: 12819304Speter 12919304Speter --enable-tknvi 13019304Speter 13119304Speter as an argument to configure. If your Tk/Tcl include files and 13219304Speter libraries aren't in the standard library and include locations, 13319304Speter see the next section of this README file for more information. 13419304Speter 13519304Speter=-=-=-=-=-=-= 13619304SpeterADDING OR CHANGING COMPILERS, OR COMPILE OR LOAD LINE FLAGS 13719304Speter=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 13819304Speter 13919304SpeterIf you want to use a specific compiler, specify the CC environment 14019304Spetervariable before running configure. For example: 14119304Speter 14219304Speter env CC=gcc configure 14319304Speter 14419304SpeterUsing anything other than the native compiler will almost certainly 14519304Spetermean that you'll want to check the compile and load line flags, too. 14619304Speter 14719304SpeterIf you want to specify additional load line flags, specify the ADDLDFLAGS 14819304Speterenvironment variable before running configure. For example: 14919304Speter 15019304Speter env ADDLDFLAGS="-Q" configure 15119304Speter 15219304Speterwould specify the -Q flag in the load line when the nvi programs are 15319304Speterloaded. 15419304Speter 15519304SpeterIf you don't want configure to use the default load line flags for the 15619304Spetersystem, specify the LDFLAGS environment variable before running configure. 15719304SpeterFor example: 15819304Speter 15919304Speter env LDFLAGS="-32" configure 16019304Speter 16119304Speterwill cause configure to set the load line flags to "-32", and not set 16219304Speterthem based on the current system. 16319304Speter 16419304SpeterIf you want to specify additional compile line flags, specify the 16519304SpeterADDCPPFLAGS environment variable before running configure. For example: 16619304Speter 16719304Speter env ADDCPPFLAGS="-I../foo" configure 16819304Speter 16919304Speterwould cause the compiler to be passed the -I../foo flag when compiling 17019304Spetertest programs during configuration as well as when building nvi object 17119304Speterfiles. 17219304Speter 17319304SpeterIf you don't want configure to use the default compile line flags for the 17419304Spetersystem, specify the CPPFLAGS environment variable before running configure. 17519304SpeterFor example: 17619304Speter 17719304Speter env CPPFLAGS="-I.." configure 17819304Speter 17919304Speterwill cause configure to use "-I.." as the compile line flags instead of 18019304Speterthe default values. 18119304Speter 18219304Speter=-=-=-=-=-=-= 18319304SpeterADDING LIBRARIES AND INCLUDE FILES 18419304Speter=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 18519304Speter 18619304SpeterIf the Tk/Tcl or any other include files or libraries are in non-standard 18719304Speterplaces on your system, you will need to specify the directory path where 18819304Speterthey can be found. 18919304Speter 19019304SpeterIf you want to specify additional library paths, set the ADDLIBS environment 19119304Spetervariable before running configure. For example: 19219304Speter 19319304Speter env ADDLIBS="-L/a/b -L/e/f -ldb" configure 19419304Speter 19519304Speterwould specify two additional directories to search for libraries, /a/b 19619304Speterand /e/f, and one additional library to load, "db". 19719304Speter 19819304SpeterIf you want to specify additional include paths, specify the ADDCPPFLAGS 19919304Speterenvironment variable before running configure. For example: 20019304Speter 20119304Speter env ADDCPPFLAGS="-I/usr/local/include" LIBS="-ldb" configure 20219304Speter 20319304Speterwould search /usr/local/include for include files, as well as load the db 20419304Speterlibrary as described above. 20519304Speter 20619304SpeterAs a final example, let's say that you've downloaded ncurses from the net 20719304Speterand you've built it in a directory named ncurses which is at the same 20819304Speterlevel in the filesystem hierarchy as nvi. You would enter something like: 20919304Speter 21019304Speter env ADDCPPFLAGS="-I../../ncurses/include" \ 21119304Speter ADDLIBS="-L../../ncurses/libraries" configure 21219304Speter 21319304Speterto cause nvi to look for the curses include files and the curses library 21419304Speterin the ncurses environment. 21519304Speter 21619304SpeterNotes: 21719304Speter Make sure that you prepend -L to any library directory names, and 21819304Speter that you prepend -I to any include file directory names! Also, 21919304Speter make sure that you quote the paths as shown above, i.e. with 22019304Speter single or double quotes around the values you're specifying for 22119304Speter ADDCPPFLAGS and ADDLIBS. 22219304Speter 22319304Speter =-=-=-=-=-= 22419304Speter You should NOT need to add any libraries or include files to load 22519304Speter the Perl5 interpreter. The configure script will obtain that 22619304Speter information directly from the Perl5 program. This means that the 22719304Speter configure script must be able to find perl in its path. It looks 22819304Speter for "perl5" first, and then "perl". If you're building a Perl 22919304Speter interpreter and neither is found, it's a fatal error. 23019304Speter 23119304Speter =-=-=-=-=-= 23219304Speter You do not need to specify additional libraries to load Tk/Tcl, 23319304Speter Perl or curses, as the nvi configuration script adds the 23419304Speter appropriate libraries to the load line whenever you specify 23519304Speter --enable-tknvi or other Perl or Tk/Tcl related option, or build 23619304Speter the Tk/Tcl or curses version of nvi. The library names that are 23719304Speter automatically loaded are as follows: 23819304Speter 23919304Speter for Perl: -lperl 24019304Speter for Tk/Tcl: -ltk -ltcl -lm 24119304Speter for curses: -lcurses 24219304Speter 24319304Speter In addition, the configure script loads: 24419304Speter 24519304Speter ... the X libraries when loading the Tk/Tcl libraries, 24619304Speter if they exist. 24719304Speter 24819304Speter ... the -ltermcap or -ltermlib libraries when loading 24919304Speter any curses library, if they exist. 25019304Speter 25119304Speter =-=-=-=-=-= 25219304Speter The env command is available on most systems, and simply sets one 25319304Speter or more environment variables before running a command. If the 25419304Speter env command is not available to you, you can set the environment 25519304Speter variables in your shell before running configure. For example, 25619304Speter in sh or ksh, you could do: 25719304Speter 25819304Speter ADDLIBS="-L/a/b -L/e/f -ldb" configure 25919304Speter 26019304Speter and in csh or tcsh, you could do: 26119304Speter 26219304Speter setenv ADDLIBS "-L/a/b -L/e/f -ldb" 26319304Speter configure 26419304Speter 26519304Speter See your shell manual page for further information. 26619304Speter 26719304Speter=-=-=-=-=-=-= 26819304SpeterINSTALLING NVI 26919304Speter=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 27019304Speter 27119304SpeterNvi installs the following files into the following locations, with 27219304Speterthe following default values: 27319304Speter 27419304SpeterVariables: Default value: 27519304Speterprefix /usr/local 27619304Speterexec_prefix $(prefix) 27719304Speterbindir $(prefix)/bin 27819304Speterdatadir $(prefix)/share 27919304Spetermandir $(prefix)/man 28019304Speter 28119304SpeterFile(s): Default location 28219304Speter---------------------------------------- 28319304Spetervi $(bindir)/vi 28419304Spetervi.1 $(mandir)/man1/vi.1 28519304Spetervi.0 $(mandir)/cat1/vi.0 28619304SpeterPerl scripts $(datadir)/vi/perl/ 28719304SpeterTcl scripts $(datadir)/vi/tcl/ 28819304SpeterMessage Catalogs $(datadir)/vi/catalog/ 28919304Speter 29019304SpeterNotes: 29119304Speter There are two hard links to the vi program, named ex and view. 29219304Speter Similarly, there are two hard links to the unformatted vi manual 29319304Speter page, named ex.1 and view.1, and two hard links to the formatted 29419304Speter manual page, named ex.0 and view.0. These links are created when 29519304Speter the program and man pages are installed. 29619304Speter 29719304Speter If you want to install vi, ex, view and the man pages as nvi, nex, 29819304Speter nview, use the configure option --program-prefix=n. Other, more 29919304Speter complex transformations are possible -- use configure --help to 30019304Speter see more options. 30119304Speter 30219304Speter To move the entire installation tree somewhere besides /usr/local, 30319304Speter change the value of both "exec_prefix" and "prefix". To move the 30419304Speter binaries to a different place, change the value of "bindir". 30519304Speter Similarly, to put the datafiles (the message catalogs, Perl and 30619304Speter Tcl scripts) or the man pages in a different place, change the 30719304Speter value of "datadir" or "mandir". These values can be changed as 30819304Speter part of configuration: 30919304Speter 31019304Speter configure --exec_prefix=/usr/contrib --prefix=/usr/share 31119304Speter 31219304Speter or when doing the install itself: 31319304Speter 31419304Speter make exec_prefix=/usr/contrib prefix=/usr/contrib install 31519304Speter 31619304Speter The datafile directory (e.g., /usr/local/share/vi by default) is 31719304Speter completely removed and then recreated as part of the installation 31819304Speter process. 31919304Speter 32019304Speter=-=-=-=-=-=-= 32119304SpeterNVI AND THE CURSES LIBRARY 32219304Speter=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 32319304Speter 32419304SpeterThe major portability problem for nvi is selecting a curses library. 32519304SpeterUnfortunately, it is common to find broken versions of curses -- the 32619304Speteroriginal System V curses was broken, resulting in all vendors whose 32719304Speterimplementations are derived from System V having broken implementations 32819304Speterin turn. 32919304Speter 33019304SpeterFor this reason, BY DEFAULT, nvi uses the stripped-down curses library 33119304Speterthat's included in its distribution. Of course, it would be preferable 33219304Speterto use the vendor's curses library, or one of the newer implementations 33319304Speterof curses, e.g., ncurses. 33419304Speter 33519304SpeterTo use the vendor's curses library, specify the: 33619304Speter 33719304Speter --disable-curses 33819304Speter 33919304Speterargument to the configure command. If you use the vendor's or other 34019304Spetercurses library, and you see any of the following symptoms: 34119304Speter 34219304Speter + Core dumps in curses routines. 34319304Speter + Missing routines when compiling. 34419304Speter + Repainting the wrong characters on the screen. 34519304Speter + Displaying inverse video in the wrong places. 34619304Speter + Failure to reset your terminal to the correct modes on exit. 34719304Speter 34819304Speteryou have a broken curses implementation, and you should reconfigure nvi 34919304Speterto use another curses library or the curses library provided with nvi. 35019304Speter 35119304SpeterThere are two alternative sources for curses libraries: 35219304Speter 35319304Speter#1: Compile the 4BSD curses library from any of the recent BSD 35419304Speter releases: FreeBSD, NetBSD or 4.4BSD-Lite release 2. These 35519304Speter libraries should be able to support nvi. 35619304Speter 35719304Speter#2: Retrieve and build the ncurses library. This library is not 35819304Speter recommended unreservedly, at least for now, for two reasons. 35919304Speter First, it can't be built on any system where the compiler 36019304Speter doesn't support function prototypes. Second, it currently has 36119304Speter a few bugs in its support for nvi. It mostly works, but it's 36219304Speter still not quite right. 36319304Speter 36419304SpeterOne final note. If you see the following symptoms: 36519304Speter 36619304Speter + Line-by-line screen repainting instead of scrolling. 36719304Speter 36819304Speterit usually means that your termcap or terminfo information is insufficient 36919304Speterfor the terminal. 370