INSTALL revision 50276
1-- $Id: INSTALL,v 1.32 1999/07/24 21:06: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    ************************************************************
8
9You should be reading the file INSTALL in a directory called ncurses-d.d, where
10d.d is the current version number.  There should be several subdirectories,
11including `c++', `form', `man', `menu', 'misc', `ncurses', `panel', `progs',
12and `test'.  See the README file for a roadmap to the package.
13
14If you are a Linux or FreeBSD or NetBSD distribution integrator or packager,
15please read and act on the section titled IF YOU ARE A SYSTEM INTEGRATOR
16below.
17
18If you are converting from BSD curses and do not have root access, be sure
19to read the BSD CONVERSION NOTES section below.
20
21If you are using a version of XFree86 xterm older than 3.1.2F, see the section
22on RECENT XTERM VERSIONS below.
23
24If you are trying to build GNU Emacs using ncurses for terminal support,
25read the USING NCURSES WITH EMACS section below.
26
27If you are trying to build applications using gpm with ncurses,
28read the USING NCURSES WITH GPM section below.
29
30If you are trying to build Elvis using ncurses for terminal support,
31read the USING NCURSES WITH ELVIS section below.
32
33If you are running over the Andrew File System see the note below on
34USING NCURSES WITH AFS.
35
36If you want to build the Ada95 binding, go to the Ada95 directory and
37follow the instructions there.  The Ada95 binding is not covered below.
38
39If you are using anything but (a) Linux, or (b) one of the 4.4BSD-based
40i386 Unixes, go read the Portability section in the TO-DO file before you
41do anything else.
42
43REQUIREMENTS:
44
45You will need the following in order to build and install ncurses under UNIX:
46
47	* ANSI C compiler  (gcc is recommended)
48	* sh               (bash will do)
49	* awk              (mawk or gawk will do)
50	* sed
51	* BSD or System V style install (a script is enclosed)
52
53Ncurses has been also built in the OS/2 EMX environment.
54
55INSTALLATION PROCEDURE:
56
571.  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
59    with it.
60
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.
65
66    The package gets installed beneath the --prefix directory as follows:
67
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
74
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.
78
792.  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.
83
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
86    file for your system.
87
88    The `configure' script generates makefile rules for one or more object
89    models and their associated libraries:
90
91	libncurses.a (normal)
92
93	libcurses.a (normal, a link to libncurses.a)
94		This gets left out if you configure with --disable-overwrite.
95
96	libncurses.so (shared)
97
98	libncurses_g.a (debug)
99
100	libncurses_p.a (profile)
101
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:
104
105    	./configure --with-normal --with-debug --enable-overwrite
106
107    Typing
108
109    	./configure --with-shared
110
111    makes the shared libraries the default, resulting in
112
113    	./configure --with-shared --with-normal --with-debug --enable-overwrite
114
115    If you want only shared libraries, type
116
117    	./configure --with-shared --without-normal --without-debug
118
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.
123
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.
129
1303.  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.
135
1364.  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
139    the test programs.
140    
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).
146
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.
150
1515.  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:
155
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
161			        compiled).
162	'make install.man'      installs the man pages.
163
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  ############################################################################
170
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
174    to be sure.
175
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.
181
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.
185
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.
190
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.
194
195    See the BSD CONVERSION NOTES section below for a few more details.
196
1976.  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.
200
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.
203
2047.  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'.
209
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.
213
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).
218
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.
223
224IF YOU ARE A SYSTEM INTEGRATOR:
225
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.
229
230    Configuration and Installation:
231
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
237	data directory.
238
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!).
245
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/tinfo/read_termcap.c for details.
251
252	Note that if you have $TERMCAP set, ncurses will use that value
253	to locate termcap data.  In particular, running from xterm will
254	set $TERMCAP to the contents of the xterm's termcap entry.
255	If ncurses sees that, it will not examine /etc/termcap.
256
257    Keyboard Mapping:
258
259	The terminfo file assumes that Shift-Tab generates \E[Z (the ECMA-48
260	reverse-tabulation sequence) rather than ^I.  Here are the loadkeys -d
261	mappings that will set this up:
262
263		keycode  15 = Tab             Tab
264			alt     keycode  15 = Meta_Tab
265			shift	keycode  15 = F26
266		string F26 ="\033[Z"
267
268    Naming the Console Terminal
269
270	In various Linuxes (and possibly elsewhere) there has been a practice
271	of designating the system console driver type as `console'.  Please
272	do not do this any more!  It complicates peoples' lives, because it
273	can mean that several different terminfo entries from different
274	operating systems all logically want to be called `console'.
275
276	Please pick a name unique to your console driver and set that up
277	in the /etc/inittab table or local equivalent.  Send the entry to the
278	terminfo maintainer (listed in the misc/terminfo file) to be included
279	in the terminfo file, if it's not already there.  See the
280	term(7) manual page included with this distribution for more on
281	conventions for choosing type names.
282
283	Here are some recommended primary console names:
284
285		linux	-- Linux console driver
286		freebsd	-- FreeBSD
287		netbsd	-- NetBSD
288		bsdos	-- BSD/OS
289
290	If you are responsible for integrating ncurses for one of these
291	distribution, please either use the recommended name or get back
292	to us explaining why you don't want to, so we can work out nomenclature
293	that will make users' lives easier rather than harder.
294
295RECENT XTERM VERSIONS
296	The terminfo database file included with this distribution assumes you
297	are running an XFree86 xterm based on X11R6 (i.e., xterm-r6).  The
298	earlier X11R5 entry (xterm-r5) is provided as well.
299
300	If you are running XFree86 version 3.2 (actually 3.1.2F and up), you
301	should consider using the xterm-xf86-v32 (or later, the most recent
302	version is always named "xterm-xfree86") entry, which adds ANSI color
303	and the VT220 capabilities which have been added in XFree86.  If you
304	are running a mixed network, however, where this terminal description
305	may be used on an older xterm, you may have problems, since
306	applications that assume these capabilities will produce incorrect
307	output on the older xterm (e.g., highlighting is not cleared).
308
309CONFIGURING FALLBACK ENTRIES
310	In order to support operation of ncurses programs before the terminfo
311	tree is accessible (that is, in single-user mode or at OS installation
312	time) the ncurses library can be compiled to include an array of
313	pre-fetched fallback entries.
314
315	These entries are checked by setupterm() only when the conventional
316	fetches from the terminfo tree and the termcap fallback (if configured)
317	have been tried and failed.  Thus, the presence of a fallback will not
318	shadow modifications to the on-disk entry for the same type, when that
319	entry is accessible.
320
321	By default, there are no entries on the fallback list.  After you
322	have built the ncurses suite for the first time, you can change
323	the list (the process needs infocmp(1)).  To do so, use the script
324	MKfallback.sh.  A configure script option --with-fallbacks does this
325	(it accepts a comma-separated list of the names you wish, and does
326	not require a rebuild).
327
328	If you wanted (say) to have linux, vt100, and xterm fallbacks, you
329	would use the commands
330
331		cd ncurses;
332		MKfallback.sh linux vt100 xterm >fallback.c
333
334	Then just rebuild and reinstall the library as you would normally.
335	You can restore the default empty fallback list with
336
337		MKfallback.sh >fallback.c
338
339	The overhead for an empty fallback list is one trivial stub function.
340	Any non-empty fallback list is const-ed and therefore lives in sharable
341	text space.  You can look at the comment trailing each initializer in
342	the generated ncurses/fallback.c file to see the core cost of the
343	fallbacks.  A good rule of thumb for modern vt100-like entries is that
344	each one will cost about 2.5K of text space.
345
346BSD CONVERSION NOTES:
347	If you need to support really ancient BSD programs, you probably
348	want to configure with the --enable-bsdpad option.  What this does
349	is enable code in tputs() that recognizes a numeric prefix on a
350	capability as a request for that much trailing padding in milliseconds.
351	There are old BSD programs that do things like tputs("50").
352
353	(If you are distributing ncurses as a support-library component of
354	an application you probably want to put the remainder of this section
355	in the package README file.)
356
357        The following note applies only if you have configured ncurses with
358	--enable-termcap.
359
360------------------------------- CUT HERE --------------------------------
361
362If you are installing this application privately (either because you
363have no root access or want to experiment with it before doing a root
364installation), there are a couple of details you need to be aware of.
365They have to do with the ncurses library, which uses terminfo rather
366than termcap for describing terminal characteristics.
367
368Though the ncurses library is terminfo-based, it will interpret your
369TERMCAP variable (if present), any local termcap files you reference
370through it, and the system termcap file.  However, in order to avoid
371slowing down your application startup, it will only do this once per
372terminal type!
373
374The first time you load a given terminal type from your termcap
375database, the library initialization code will automatically write it
376in terminfo format to a subdirectory under $HOME/.terminfo.  After
377that, the initialization code will find it there and do a (much
378faster) terminfo fetch.
379
380Usually, all this means is that your home directory will silently grow
381an invisible .terminfo subdirectory which will get filled in with
382terminfo descriptions of terminal types as you invoke them.  If anyone
383ever installs a global terminfo tree on your system, this will quietly
384stop happening and your $HOME/.terminfo will become redundant.
385
386The objective of all this logic is to make converting from BSD termcap
387as painless as possible without slowing down your application (termcap
388compilation is expensive).
389
390If you don't have a TERMCAP variable or custom personal termcap file,
391you can skip the rest of this dissertation.
392
393If you *do* have a TERMCAP variable and/or a custom personal termcap file
394that defines a terminal type, that definition will stop being visible
395to this application after the first time you run it, because it will
396instead see the terminfo entry that it wrote to $HOME/terminfo the
397first time around.
398
399Subsequently, editing the TERMCAP variable or personal TERMCAP file
400will have no effect unless you explicitly remove the terminfo entry
401under $HOME/terminfo.  If you do that, the entry will be recompiled
402from your termcap resources the next time it is invoked.
403
404To avoid these complications, use infocmp(1) and tic(1) to edit the
405terminfo directory directly.
406
407------------------------------- CUT HERE --------------------------------
408
409USING NCURSES WITH AFS:
410	AFS treats each directory as a separate logical filesystem, you
411	can't hard-link across them.  The --enable-symlinks option copes
412	with this by making tic use symbolic links.
413
414USING NCURSES WITH EMACS:
415	GNU Emacs has its own termcap support.  By default, it uses a mixture
416	of those functions and code linked from the host system's libraries.
417	You need to foil this and shut out the GNU termcap library entirely.
418
419	In order to do this, hack the Linux config file (s/linux.h) to contain
420	a #define TERMINFO and set the symbol LIBS_TERMCAP to "-lncurses".
421
422	We have submitted such a change for the 19.30 release, so it may
423	already be applied in your sources -- check for the #define TERMINFO.
424
425USING NCURSES WITH GPM:
426	Ncurses 4.1 and up can be configured to use GPM (General Purpose Mouse)
427	which is used on Linux console.  Be aware that GPM is commonly
428	installed as a shared library which contains a wrapper for the curses
429	wgetch() function (libcurses.o).  Some integrators have simplified
430	linking applications by combining all of libcurses.so (the BSD curses)
431	into the libgpm.so file, producing symbol conflicts with ncurses.  You
432	may be able to work around this problem by linking as follows:
433
434		cc -o foo foo.o -lncurses -lgpm -lncurses
435
436	but the linker may not cooperate, producing mysterious errors.
437	A patched version of gpm is available:
438
439		ftp.clark.net:/pub/dickey/ncurses/gpm-1.10-970125.tgz
440
441	This patch is incorporated in gpm 1.12; however some integrators
442	are slow to update this library.
443
444USING NCURSES WITH ELVIS:
445	To use ncurses as the screen-painting library for Elvis, apply the
446	following patch to the Elvis curses
447
448*** curses.c.orig       Sun Jun 26 05:48:23 1994
449--- curses.c    Sun Feb 11 16:50:41 1996
450***************
451*** 986,992 ****
452  {
453        if (has_IM)
454                do_IM();
455!       do_IC();
456        qaddch(ch);
457        if (has_EI)
458                do_EI();
459--- 986,995 ----
460  {
461        if (has_IM)
462                do_IM();
463!#ifdef NCURSES_VERSION
464!       else	/* ncurses does insertion in a slightly nonstandard way */
465!#endif
466!               do_IC();
467        qaddch(ch);
468        if (has_EI)
469                do_EI();
470
471This patch is for elvis-1.8pl4 but it can even be used for elvis-1.8pl3 with
472an offset of -11 lines.
473
474BUGS:
475	Send any feedback to the ncurses mailing list at
476	bug-ncurses@gnu.org. To subscribe send mail to 
477	bug-ncurses-request@gnu.org with body that reads: 
478	subscribe ncurses <your-email-address-here>
479
480	The Hacker's Guide in the misc directory includes some guidelines
481	on how to report bugs in ways that will get them fixed most quickly.
482