1 -- $Id: INSTALL,v 1.28 1998/02/12 23:43:24 tom Exp $
2 ---------------------------------------------------------------------
3 How to install Ncurses/Terminfo on your system
4 ---------------------------------------------------------------------
5 ************************************************************
6 * READ ALL OF THIS FILE BEFORE YOU TRY TO INSTALL NCURSES. *
7 ************************************************************
9 You should be reading the file INSTALL in a directory called ncurses-d.d, where
10 d.d is the current version number. There should be several subdirectories,
11 including `c++', `form', `man', `menu', 'misc', `ncurses', `panel', `progs',
12 and `test'. See the README file for a roadmap to the package.
14 If you are a Linux or FreeBSD or NetBSD distribution integrator or packager,
15 please read and act on the section titled IF YOU ARE A SYSTEM INTEGRATOR
18 If you are converting from BSD curses and do not have root access, be sure
19 to read the BSD CONVERSION NOTES section below.
21 If you are using a version of XFree86 xterm older than 3.1.2F, see the section
22 on RECENT XTERM VERSIONS below.
24 If you are trying to build GNU Emacs using ncurses for terminal support,
25 read the USING NCURSES WITH EMACS section below.
27 If you are trying to build applications using gpm with ncurses,
28 read the USING NCURSES WITH GPM section below.
30 If you are trying to build Elvis using ncurses for terminal support,
31 read the USING NCURSES WITH ELVIS section below.
33 If you are running over the Andrew File System see the note below on
34 USING NCURSES WITH AFS.
36 If you want to build the Ada95 binding, go to the Ada95 directory and
37 follow the instructions there. The Ada95 binding is not covered below.
39 If you are using anything but (a) Linux, or (b) one of the 4.4BSD-based
40 i386 Unixes, go read the Portability section in the TO-DO file before you
45 You will need the following in order to build and install ncurses under UNIX:
47 * ANSI C compiler (gcc is recommended)
49 * awk (mawk or gawk will do)
51 * BSD or System V style install (a script is enclosed)
53 Ncurses has been also built in the OS/2 EMX environment.
55 INSTALLATION PROCEDURE:
57 1. First, decide whether you want ncurses to replace your existing library (in
58 which case you'll need super-user privileges) or be installed in parallel
61 The --prefix option to configure changes the root directory for installing
62 ncurses. The default is in subdirectories of /usr/local. Use
63 --prefix=/usr to replace your default curses distribution. This is the
64 default for Linux and BSD/OS users.
66 The package gets installed beneath the --prefix directory as follows:
68 In $(prefix)/bin: tic, infocmp, captoinfo, tset,
69 reset, clear, tput, toe
70 In $(prefix)/lib: libncurses*.* libcurses.a
71 In $(prefix)/share/terminfo: compiled terminal descriptions
72 In $(prefix)/include: C header files
73 Under $(prefix)/man: the manual pages
75 Note however that the configure script attempts to locate previous
76 installation of ncurses, and will set the default prefix according to where
77 it finds the ncurses headers.
79 2. Type `./configure' in the top-level directory of the distribution to
80 configure ncurses for your operating system and create the Makefiles.
81 Besides --prefix, various configuration options are available to customize
82 the installation; use `./configure --help' to list the available options.
84 If your operating system is not supported, read the PORTABILITY section in
85 the file ncurses/README for information on how to create a configuration
88 The `configure' script generates makefile rules for one or more object
89 models and their associated libraries:
93 libcurses.a (normal, a link to libncurses.a)
94 This gets left out if you configure with --disable-overwrite.
96 libncurses.so (shared)
98 libncurses_g.a (debug)
100 libncurses_p.a (profile)
102 If you do not specify any models, the normal and debug libraries will be
103 configured. Typing `configure' with no arguments is equivalent to:
105 ./configure --with-normal --with-debug --enable-overwrite
109 ./configure --with-shared
111 makes the shared libraries the default, resulting in
113 ./configure --with-shared --with-normal --with-debug --enable-overwrite
115 If you want only shared libraries, type
117 ./configure --with-shared --without-normal --without-debug
119 Rules for generating shared libraries are highly dependent upon the choice
120 of host system and compiler. We've been testing shared libraries on Linux
121 and SunOS with gcc, but more work needs to be done to make shared libraries
122 work on other systems.
124 You can make curses and terminfo fall back to an existing file of termcap
125 definitions by configuring with --enable-termcap. If you do this, the
126 library will search /etc/termcap before the terminfo database, and will
127 also interpret the contents of the TERM environment variable. See the
128 section BSD CONVERSION NOTES below.
130 3. Type `make'. Ignore any warnings, no error messages should be produced.
131 This should compile the ncurses library, the terminfo compiler tic(1),
132 captoinfo(1), infocmp(1), toe(1), clear(1) tset(1), reset(1), and tput(1)
133 programs (see the man pages for explanation of what they do), some test
134 programs, and the panels, menus, and forms libraries.
136 4. Run ncurses and several other test programs in the test directory to
137 verify that ncurses functions correctly before doing an install that
138 may overwrite system files. Read the file test/README for details on
141 NOTE: You must have installed the terminfo database, or set the
142 environment variable $TERMINFO to point to a SVr4-compatible terminfo
143 database before running the test programs. Not all vendors' terminfo
144 databases are SVr4-compatible, but most seem to be. Exceptions include
145 DEC's Digital Unix (formerly known as OSF/1).
147 The ncurses program is designed specifically to test the ncurses library.
148 You can use it to verify that the screen highlights work correctly, that
149 cursor addressing and window scrolling works OK, etc.
151 5. Once you've tested, you can type `make install' to install libraries,
152 the programs, the terminfo database and the man pages. Alternately, you
153 can type `make install' in each directory you want to install. In the
154 top-level directory, you can do a partial install using these commands:
156 'make install.progs' installs tic, infocmp, etc...
157 'make install.includes' installs the headers.
158 'make install.libs' installs the libraries (and the headers).
159 'make install.data' installs the terminfo data. (Note: `tic' must
160 be installed before the terminfo data can be
162 'make install.man' installs the man pages.
164 ############################################################################
165 # CAVEAT EMPTOR: `install.data' run as root will NUKE any existing #
166 # terminfo database. If you have any custom or unusual entries SAVE them #
167 # before you install ncurses. I have a file called terminfo.custom for #
168 # this purpose. Don't forget to run tic on the file once you're done. #
169 ############################################################################
171 The terminfo(5) manual page wants to be preprocessed with tbl(1) before
172 being formatted by nroff(1). Modern man(1) implementations tend to do
173 this by default, but you may want to look at your version's man page
176 If the system already has a curses library that you need to keep using
177 for some bizarre binary-compatibility reason, you'll need to distinguish
178 between it and ncurses. If ncurses is installed outside the standard
179 directories (/usr/include and /usr/lib) then all your users will need
180 to use the -I option to compile programs and -L to link them.
182 If you have BSD curses installed in your system and you accidentally
183 compile using its curses.h you'll end up with a large number of
184 undefined symbols at link time. _waddbytes is one of them.
186 IF YOU DO NOT HAVE ROOT: Change directory to the `progs' subdirectory
187 and run the `capconvert' script. This script will deduce various things
188 about your environment and use them to build you a private terminfo tree,
189 so you can use ncurses applications.
191 If more than one user at your site does this, the space for the duplicate
192 trees is wasted. Try to get your site administrators to install a system-
193 wide terminfo tree instead.
195 See the BSD CONVERSION NOTES section below for a few more details.
197 6. The c++ directory has C++ classes that are built on top of ncurses and
198 panels. You need to have c++ (and its libraries) installed before you can
199 compile and run the demo.
201 If you do not have C++, you must use the --without-cxx option to tell
202 the configure script to not attempt to build the C++ bindings.
204 7. If you're running an older Linux, you must either (a) tell Linux that the
205 console terminal type is `linux' or (b) make a link to or copy of the
206 linux entry in the appropriate place under your terminfo directory, named
207 `console'. All 1.3 and many 1.2 distributions (including Yggdrasil and
208 Red Hat) already have the console type set to `linux'.
210 The way to change the wired-in console type depends on the configuration
211 of your system. This may involve editing /etc/inittab, /etc/ttytype,
212 /etc/profile and other such files.
214 Warning: this is not for the fainthearted, if you mess up your console
215 getty entries you can make your system unusable! However, if you are
216 a distribution maker, this is the right thing to do (see the note for
217 integrators near the end of this file).
219 The easier way is to link or copy l/linux to c/console under your terminfo
220 directory. Note: this will go away next time you do `make install.data'
221 and you'll have to redo it. There is no need to have entries for all
222 possible screen sizes, ncurses will figure out the size automatically.
224 IF YOU ARE A SYSTEM INTEGRATOR:
226 Beginning with 1.9.9, the ncurses distribution includes both a tset
227 utility and /usr/share/tabset directory. If you are installing ncurses,
228 it is no longer either necessary or desirable to install tset-jv.
230 Configuration and Installation:
232 Configure with --prefix=/usr to make the install productions put
233 libraries and headers in the correct locations (overwriting any
234 previous curses libraries and headers). This will put the terminfo
235 hierarchy under /usr/share/terminfo; you may want to override this with
236 --datadir=/usr/share/misc; terminfo and tabset are installed under the
239 Please configure the ncurses library in a pure-terminfo mode; that
240 is, with the --disable-termcap option. This will make the ncurses
241 library smaller and faster. The ncurses library includes a termcap
242 emulation that queries the terminfo database, so even applications
243 that use raw termcap to query terminal characteristics will win
244 (providing you recompile and relink them!).
246 If you must configure with termcap fallback enabled, you may also
247 wish to use the --enable-getcap option. This option speeds up
248 termcap-based startups, at the expense of not allowing personal
249 termcap entries to reference the terminfo tree. See the code in
250 ncurses/read_termcap.c for details.
254 The terminfo file assumes that Shift-Tab generates \E[Z (the ECMA-48
255 reverse-tabulation sequence) rather than ^I. Here are the loadkeys -d
256 mappings that will set this up:
259 alt keycode 15 = Meta_Tab
260 shift keycode 15 = F26
263 Naming the Console Terminal
265 In various Linuxes (and possibly elsewhere) there has been a practice
266 of designating the system console driver type as `console'. Please
267 do not do this any more! It complicates peoples' lives, because it
268 can mean that several different terminfo entries from different
269 operating systems all logically want to be called `console'.
271 Please pick a name unique to your console driver and set that up
272 in the /etc/inittab table or local equivalent. Send the entry to the
273 terminfo maintainer (listed in the misc/terminfo file) to be included
274 in the terminfo file, if it's not already there. See the
275 term(7) manual page included with this distribution for more on
276 conventions for choosing type names.
278 Here are our recommended primary console names for the most important
279 freeware UNIX distributions:
281 linux -- Linux console driver
286 If you are responsible for integrating ncurses for one of these
287 distribution, please either use the recommended name or get back
288 to us explaining why you don't want to, so we can work out nomenclature
289 that will make users' lives easier rather than harder.
291 RECENT XTERM VERSIONS
292 The terminfo database file included with this distribution assumes you
293 are running an XFree86 xterm based on X11R6 (i.e., xterm-r6). The
294 earlier X11R5 entry (xterm-r5) is provided as well.
296 If you are running XFree86 version 3.2 (actually 3.1.2F and up), you
297 should consider using the xterm-xf86-v32 entry, which adds ANSI color
298 and the VT220 capabilities which have been added in XFree86. If you
299 are running a mixed network, however, where this terminal description
300 may be used on an older xterm, you may have problems, since
301 applications that assume these capabilities will produce incorrect
302 output on the older xterm (e.g., highlighting is not cleared).
304 CONFIGURING FALLBACK ENTRIES
305 In order to support operation of ncurses programs before the terminfo
306 tree is accessible (that is, in single-user mode or at OS installation
307 time) the ncurses library can be compiled to include an array of
308 pre-fetched fallback entries.
310 These entries are checked by setupterm() only when the conventional
311 fetches from the terminfo tree and the termcap fallback (if configured)
312 have been tried and failed. Thus, the presence of a fallback will not
313 shadow modifications to the on-disk entry for the same type, when that
316 By default, there are no entries on the fallback list. After you
317 have built the ncurses suite for the first time, you can change
318 the list (the process needs infocmp(1)). To do so, use the script
319 MKfallback.sh. A configure script option --with-fallbacks does this
320 (it accepts a comma-separated list of the names you wish, and does
321 not require a rebuild).
323 If you wanted (say) to have linux, vt100, and xterm fallbacks, you
324 would use the commands
327 MKfallback.sh linux vt100 xterm >fallback.c
329 Then just rebuild and reinstall the library as you would normally.
330 You can restore the default empty fallback list with
332 MKfallback.sh >fallback.c
334 The overhead for an empty fallback list is one trivial stub function.
335 Any non-empty fallback list is const-ed and therefore lives in sharable
336 text space. You can look at the comment trailing each initializer in
337 the generated ncurses/fallback.c file to see the core cost of the
338 fallbacks. A good rule of thumb for modern vt100-like entries is that
339 each one will cost about 2.5K of text space.
341 BSD CONVERSION NOTES:
342 If you need to support really ancient BSD programs, you probably
343 want to configure with the --enable-bsdpad option. What this does
344 is enable code in tputs() that recognizes a numeric prefix on a
345 capability as a request for that much trailing padding in milliseconds.
346 There are old BSD programs that do things like tputs("50").
348 (If you are distributing ncurses as a support-library component of
349 an application you probably want to put the remainder of this section
350 in the package README file.)
352 The following note applies only if you have configured ncurses with
355 ------------------------------- CUT HERE --------------------------------
357 If you are installing this application privately (either because you
358 have no root access or want to experiment with it before doing a root
359 installation), there are a couple of details you need to be aware of.
360 They have to do with the ncurses library, which uses terminfo rather
361 than termcap for describing terminal characteristics.
363 Though the ncurses library is terminfo-based, it will interpret your
364 TERMCAP variable (if present), any local termcap files you reference
365 through it, and the system termcap file. However, in order to avoid
366 slowing down your application startup, it will only do this once per
369 The first time you load a given terminal type from your termcap
370 database, the library initialization code will automatically write it
371 in terminfo format to a subdirectory under $HOME/.terminfo. After
372 that, the initialization code will find it there and do a (much
373 faster) terminfo fetch.
375 Usually, all this means is that your home directory will silently grow
376 an invisible .terminfo subdirectory which will get filled in with
377 terminfo descriptions of terminal types as you invoke them. If anyone
378 ever installs a global terminfo tree on your system, this will quietly
379 stop happening and your $HOME/.terminfo will become redundant.
381 The objective of all this logic is to make converting from BSD termcap
382 as painless as possible without slowing down your application (termcap
383 compilation is expensive).
385 If you don't have a TERMCAP variable or custom personal termcap file,
386 you can skip the rest of this dissertation.
388 If you *do* have a TERMCAP variable and/or a custom personal termcap file
389 that defines a terminal type, that definition will stop being visible
390 to this application after the first time you run it, because it will
391 instead see the terminfo entry that it wrote to $HOME/terminfo the
394 Subsequently, editing the TERMCAP variable or personal TERMCAP file
395 will have no effect unless you explicitly remove the terminfo entry
396 under $HOME/terminfo. If you do that, the entry will be recompiled
397 from your termcap resources the next time it is invoked.
399 To avoid these complications, use infocmp(1) and tic(1) to edit the
400 terminfo directory directly.
402 ------------------------------- CUT HERE --------------------------------
404 USING NCURSES WITH AFS:
405 AFS treats each directory as a separate logical filesystem, you
406 can't hard-link across them. The --enable-symlinks option copes
407 with this by making tic use symbolic links.
409 USING NCURSES WITH EMACS:
410 GNU Emacs has its own termcap support. By default, it uses a mixture
411 of those functions and code linked from the host system's libraries.
412 You need to foil this and shut out the GNU termcap library entirely.
414 In order to do this, hack the Linux config file (s/linux.h) to contain
415 a #define TERMINFO and set the symbol LIBS_TERMCAP to "-lncurses".
417 We have submitted such a change for the 19.30 release, so it may
418 already be applied in your sources -- check for the #define TERMINFO.
420 USING NCURSES WITH GPM:
421 Ncurses 4.1 and up can be configured to use GPM (General Purpose Mouse)
422 which is used on Linux console. Be aware that GPM is commonly
423 installed as a shared library which contains a wrapper for the curses
424 wgetch() function (libcurses.o). Some integrators have simplified
425 linking applications by combining all of libcurses.so (the BSD curses)
426 into the libgpm.so file, producing symbol conflicts with ncurses. You
427 may be able to work around this problem by linking as follows:
429 cc -o foo foo.o -lncurses -lgpm -lncurses
431 but the linker may not cooperate, producing mysterious errors.
432 A patched version of gpm is available:
434 ftp.clark.net:/pub/dickey/ncurses/gpm-1.10-970125.tgz
436 This patch is incorporated in gpm 1.12; however some integrators
437 are slow to update this library.
439 USING NCURSES WITH ELVIS:
440 To use ncurses as the screen-painting library for Elvis, apply the
441 following patch to the Elvis curses
443 *** curses.c.orig Sun Jun 26 05:48:23 1994
444 --- curses.c Sun Feb 11 16:50:41 1996
458 !#ifdef NCURSES_VERSION
459 ! else /* ncurses does insertion in a slightly nonstandard way */
466 This patch is for elvis-1.8pl4 but it can even be used for elvis-1.8pl3 with
467 an offset of -11 lines.
470 Send any feedback to the ncurses mailing list at
471 ncurses@bsdi.com. To subscribe send mail to
472 ncurses-request@mailgate.bsdi.com with body that reads:
473 subscribe ncurses <your-email-address-here>
475 The Hacker's Guide in the misc directory includes some guidelines
476 on how to report bugs in ways that will get them fixed most quickly.