1 # Id: README,v 8.29 2001/05/13 20:52:36 skimo Exp (Berkeley) Date: 2001/05/13 20:52:36 2 3 Nvi uses the GNU autoconf program for configuration and compilation. You 4 should enter: 5 6 ../dist/configure 7 make 8 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: 12 13 mkdir build.x86 14 cd build.x86 15 ../dist/configure 16 make 17 18 There are options that you can specify to the configure command. See 19 the next section for a description of these options. 20 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. 25 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: 29 30 configure --program-prefix=n 31 32 See the section below on installation for details. 33 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. 37 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. 41 42 =-=-=-=-=-=-= 43 NVI'S OPTIONS TO THE CONFIGURE PROGRAM 44 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 45 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: 49 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. 61 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: 68 69 --disable-re 70 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. 75 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: 80 81 --enable-debug 82 83 as an argument to configure. 84 85 enable-perlinterp: 86 If you have the Perl 5 libraries and you want to compile in the 87 Perl interpreter, enter: 88 89 --enable-perlinterp 90 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.) 93 94 enable-tclinterp: 95 If you have the Tk/Tcl libraries and you want to compile in the 96 Tcl/Tk interpreter, enter: 97 98 --enable-tclinterp 99 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. 103 104 enable-gtk: 105 If you have the Gtk libraries and you want to build the Gtk 106 nvi front-end, enter: 107 108 --enable-gtk 109 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. 114 115 enable-motif: 116 If you have the Motif libraries and you want to build the Motif 117 nvi front-end, enter: 118 119 --enable-motif 120 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. 124 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. 128 129 with-curses: 130 Specifies the path where curses is installed. 131 132 with-db3: 133 Specifies the path where DB3 is installed. 134 See README.DB3 for more information about DB3. 135 136 enable-dynamic-loading: 137 Dynamically load DB3 library. 138 See README.DB3 for more information about DB3. 139 140 enable-widechar: 141 Enables support for wide characters. 142 Note that this is still rather experimental. 143 144 If you try this out on Solaris, you will want to point nvi 145 to the curses in /usr/xpg4/ which is CSI compliant. 146 147 =-=-=-=-=-=-= 148 ADDING OR CHANGING COMPILERS, OR COMPILE OR LOAD LINE FLAGS 149 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 150 151 If you want to use a specific compiler, specify the CC environment 152 variable before running configure. For example: 153 154 env CC=gcc configure 155 156 Using anything other than the native compiler will almost certainly 157 mean that you'll want to check the compile and load line flags, too. 158 159 If you want to specify additional load line flags, specify the ADDLDFLAGS 160 environment variable before running configure. For example: 161 162 env ADDLDFLAGS="-Q" configure 163 164 would specify the -Q flag in the load line when the nvi programs are 165 loaded. 166 167 If you don't want configure to use the default load line flags for the 168 system, specify the LDFLAGS environment variable before running configure. 169 For example: 170 171 env LDFLAGS="-32" configure 172 173 will cause configure to set the load line flags to "-32", and not set 174 them based on the current system. 175 176 If you want to specify additional compile line flags, specify the 177 ADDCPPFLAGS environment variable before running configure. For example: 178 179 env ADDCPPFLAGS="-I../foo" configure 180 181 would cause the compiler to be passed the -I../foo flag when compiling 182 test programs during configuration as well as when building nvi object 183 files. 184 185 If you don't want configure to use the default compile line flags for the 186 system, specify the CPPFLAGS environment variable before running configure. 187 For example: 188 189 env CPPFLAGS="-I.." configure 190 191 will cause configure to use "-I.." as the compile line flags instead of 192 the default values. 193 194 =-=-=-=-=-=-= 195 ADDING LIBRARIES AND INCLUDE FILES 196 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 197 198 If the Tk/Tcl or any other include files or libraries are in non-standard 199 places on your system, you will need to specify the directory path where 200 they can be found. 201 202 If you want to specify additional library paths, set the ADDLIBS environment 203 variable before running configure. For example: 204 205 env ADDLIBS="-L/a/b -L/e/f -ldb" configure 206 207 would specify two additional directories to search for libraries, /a/b 208 and /e/f, and one additional library to load, "db". 209 210 If you want to specify additional include paths, specify the ADDCPPFLAGS 211 environment variable before running configure. For example: 212 213 env ADDCPPFLAGS="-I/usr/local/include" LIBS="-ldb" configure 214 215 would search /usr/local/include for include files, as well as load the db 216 library as described above. 217 218 As a final example, let's say that you've downloaded ncurses from the net 219 and you've built it in a directory named ncurses which is at the same 220 level in the filesystem hierarchy as nvi. You would enter something like: 221 222 env ADDCPPFLAGS="-I../../ncurses/include" \ 223 ADDLIBS="-L../../ncurses/libraries" configure 224 225 to cause nvi to look for the curses include files and the curses library 226 in the ncurses environment. 227 228 Notes: 229 Make sure that you prepend -L to any library directory names, and 230 that you prepend -I to any include file directory names! Also, 231 make sure that you quote the paths as shown above, i.e. with 232 single or double quotes around the values you're specifying for 233 ADDCPPFLAGS and ADDLIBS. 234 235 =-=-=-=-=-= 236 You should NOT need to add any libraries or include files to load 237 the Perl5 interpreter. The configure script will obtain that 238 information directly from the Perl5 program. This means that the 239 configure script must be able to find perl in its path. It looks 240 for "perl5" first, and then "perl". If you're building a Perl 241 interpreter and neither is found, it's a fatal error. 242 243 =-=-=-=-=-= 244 You do not need to specify additional libraries to load Tk/Tcl, 245 Perl or curses, as the nvi configuration script adds the 246 appropriate libraries to the load line whenever you specify 247 --enable-tknvi or other Perl or Tk/Tcl related option, or build 248 the Tk/Tcl or curses version of nvi. The library names that are 249 automatically loaded are as follows: 250 251 for Perl: -lperl 252 for Tk/Tcl: -ltk -ltcl -lm 253 for curses: -lcurses 254 255 In addition, the configure script loads: 256 257 ... the X libraries when loading the Tk/Tcl libraries, 258 if they exist. 259 260 ... the -ltermcap or -ltermlib libraries when loading 261 any curses library, if they exist. 262 263 =-=-=-=-=-= 264 The env command is available on most systems, and simply sets one 265 or more environment variables before running a command. If the 266 env command is not available to you, you can set the environment 267 variables in your shell before running configure. For example, 268 in sh or ksh, you could do: 269 270 ADDLIBS="-L/a/b -L/e/f -ldb" configure 271 272 and in csh or tcsh, you could do: 273 274 setenv ADDLIBS "-L/a/b -L/e/f -ldb" 275 configure 276 277 See your shell manual page for further information. 278 279 =-=-=-=-=-=-= 280 INSTALLING NVI 281 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 282 283 Nvi installs the following files into the following locations, with 284 the following default values: 285 286 Variables: Default value: 287 prefix /usr/local 288 exec_prefix $(prefix) 289 bindir $(prefix)/bin 290 datadir $(prefix)/share 291 mandir $(prefix)/man 292 293 File(s): Default location 294 ---------------------------------------- 295 vi $(bindir)/vi 296 vi.1 $(mandir)/man1/vi.1 297 vi.0 $(mandir)/cat1/vi.0 298 Perl scripts $(datadir)/vi/perl/ 299 Tcl scripts $(datadir)/vi/tcl/ 300 Message Catalogs $(datadir)/vi/catalog/ 301 302 Notes: 303 There are two hard links to the vi program, named ex and view. 304 Similarly, there are two hard links to the unformatted vi manual 305 page, named ex.1 and view.1, and two hard links to the formatted 306 manual page, named ex.0 and view.0. These links are created when 307 the program and man pages are installed. 308 309 If you want to install vi, ex, view and the man pages as nvi, nex, 310 nview, use the configure option --program-prefix=n. Other, more 311 complex transformations are possible -- use configure --help to 312 see more options. 313 314 To move the entire installation tree somewhere besides /usr/local, 315 change the value of both "exec_prefix" and "prefix". To move the 316 binaries to a different place, change the value of "bindir". 317 Similarly, to put the datafiles (the message catalogs, Perl and 318 Tcl scripts) or the man pages in a different place, change the 319 value of "datadir" or "mandir". These values can be changed as 320 part of configuration: 321 322 configure --exec_prefix=/usr/contrib --prefix=/usr/share 323 324 or when doing the install itself: 325 326 make exec_prefix=/usr/contrib prefix=/usr/contrib install 327 328 The datafile directory (e.g., /usr/local/share/vi by default) is 329 completely removed and then recreated as part of the installation 330 process. 331 332 =-=-=-=-=-=-= 333 NVI AND THE CURSES LIBRARY 334 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 335 336 The major portability problem for nvi is selecting a curses library. 337 Unfortunately, it is common to find broken versions of curses -- the 338 original System V curses was broken, resulting in all vendors whose 339 implementations are derived from System V having broken implementations 340 in turn. 341 342 If you use the vendor's or other curses library, and you see any of the 343 following symptoms: 344 345 + Core dumps in curses routines. 346 + Missing routines when compiling. 347 + Repainting the wrong characters on the screen. 348 + Displaying inverse video in the wrong places. 349 + Failure to reset your terminal to the correct modes on exit. 350 351 you have a broken curses implementation, and you should reconfigure nvi 352 to use another curses library. 353 354 An alternative for your vendor's curses is ncurses, available from 355 ftp://ftp.gnu.org/pub/gnu/ncurses/ 356 357 One final note. If you see the following symptoms: 358 359 + Line-by-line screen repainting instead of scrolling. 360 361 it usually means that your termcap or terminfo information is insufficient 362 for the terminal. 363