]> ncurses.scripts.mit.edu Git - ncurses.git/blob - INSTALL
ncurses 5.0
[ncurses.git] / INSTALL
1 -- $Id: INSTALL,v 1.33 1999/09/18 23:04:36 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
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.
13
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
16 below.
17
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.
20
21 If you are using a version of XFree86 xterm older than 3.1.2F, see the section
22 on RECENT XTERM VERSIONS below.
23
24 If you are trying to build GNU Emacs using ncurses for terminal support,
25 read the USING NCURSES WITH EMACS section below.
26
27 If you are trying to build applications using gpm with ncurses,
28 read the USING NCURSES WITH GPM section below.
29
30 If you are trying to build Elvis using ncurses for terminal support,
31 read the USING NCURSES WITH ELVIS section below.
32
33 If you are running over the Andrew File System see the note below on
34 USING NCURSES WITH AFS.
35
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.
38
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
41 do anything else.
42
43 REQUIREMENTS:
44
45 You 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
53 Ncurses has been also built in the OS/2 EMX environment.
54
55 INSTALLATION PROCEDURE:
56
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
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
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.
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
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.
135
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
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
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:
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
197 6.  The c++ directory has C++ classes that are built on top of ncurses and
198     panels.  You must have c++ (and its libraries) installed before you can
199     compile and run the demo.
200
201     Use --without-cxx-binding to tell configure to not build the C++ bindings
202     and demo.
203
204     If you do not have C++, you must use the --without-cxx option to tell
205     the configure script to not attempt to determine the type of 'bool'
206     which may be supported by C++.  IF YOU USE THIS OPTION, BE ADVISED THAT
207     YOU MAY NOT BE ABLE TO COMPILE (OR RUN) NCURSES APPLICATIONS WITH C++.
208     
209 7.  If you're running an older Linux, you must either (a) tell Linux that the
210     console terminal type is `linux' or (b) make a link to or copy of the
211     linux entry in the appropriate place under your terminfo directory, named
212     `console'.  All 1.3 and many 1.2 distributions (including Yggdrasil and
213     Red Hat) already have the console type set to `linux'.
214
215     The way to change the wired-in console type depends on the configuration
216     of your system. This may involve editing /etc/inittab, /etc/ttytype,
217     /etc/profile and other such files.
218
219     Warning: this is not for the fainthearted, if you mess up your console
220     getty entries you can make your system unusable!  However, if you are
221     a distribution maker, this is the right thing to do (see the note for
222     integrators near the end of this file).
223
224     The easier way is to link or copy l/linux to c/console under your terminfo
225     directory.  Note: this will go away next time you do `make install.data'
226     and you'll have to redo it. There is no need to have entries for all
227     possible screen sizes, ncurses will figure out the size automatically.
228
229 IF YOU ARE A SYSTEM INTEGRATOR:
230
231     Beginning with 1.9.9, the ncurses distribution includes both a tset
232     utility and /usr/share/tabset directory.  If you are installing ncurses,
233     it is no longer either necessary or desirable to install tset-jv.
234
235     Configuration and Installation:
236
237         Configure with --prefix=/usr to make the install productions put
238         libraries and headers in the correct locations (overwriting any
239         previous curses libraries and headers).  This will put the terminfo
240         hierarchy under /usr/share/terminfo; you may want to override this with
241         --datadir=/usr/share/misc; terminfo and tabset are installed under the
242         data directory.
243
244         Please configure the ncurses library in a pure-terminfo mode; that
245         is, with the --disable-termcap option.   This will make the ncurses
246         library smaller and faster. The ncurses library includes a termcap
247         emulation that queries the terminfo database, so even applications
248         that use raw termcap to query terminal characteristics will win
249         (providing you recompile and relink them!).
250
251         If you must configure with termcap fallback enabled, you may also
252         wish to use the --enable-getcap option.  This option speeds up
253         termcap-based startups, at the expense of not allowing personal
254         termcap entries to reference the terminfo tree.  See the code in
255         ncurses/tinfo/read_termcap.c for details.
256
257         Note that if you have $TERMCAP set, ncurses will use that value
258         to locate termcap data.  In particular, running from xterm will
259         set $TERMCAP to the contents of the xterm's termcap entry.
260         If ncurses sees that, it will not examine /etc/termcap.
261
262     Keyboard Mapping:
263
264         The terminfo file assumes that Shift-Tab generates \E[Z (the ECMA-48
265         reverse-tabulation sequence) rather than ^I.  Here are the loadkeys -d
266         mappings that will set this up:
267
268                 keycode  15 = Tab             Tab
269                         alt     keycode  15 = Meta_Tab
270                         shift   keycode  15 = F26
271                 string F26 ="\033[Z"
272
273     Naming the Console Terminal
274
275         In various Linuxes (and possibly elsewhere) there has been a practice
276         of designating the system console driver type as `console'.  Please
277         do not do this any more!  It complicates peoples' lives, because it
278         can mean that several different terminfo entries from different
279         operating systems all logically want to be called `console'.
280
281         Please pick a name unique to your console driver and set that up
282         in the /etc/inittab table or local equivalent.  Send the entry to the
283         terminfo maintainer (listed in the misc/terminfo file) to be included
284         in the terminfo file, if it's not already there.  See the
285         term(7) manual page included with this distribution for more on
286         conventions for choosing type names.
287
288         Here are some recommended primary console names:
289
290                 linux   -- Linux console driver
291                 freebsd -- FreeBSD
292                 netbsd  -- NetBSD
293                 bsdos   -- BSD/OS
294
295         If you are responsible for integrating ncurses for one of these
296         distribution, please either use the recommended name or get back
297         to us explaining why you don't want to, so we can work out nomenclature
298         that will make users' lives easier rather than harder.
299
300 RECENT XTERM VERSIONS
301         The terminfo database file included with this distribution assumes you
302         are running an XFree86 xterm based on X11R6 (i.e., xterm-r6).  The
303         earlier X11R5 entry (xterm-r5) is provided as well.
304
305         If you are running XFree86 version 3.2 (actually 3.1.2F and up), you
306         should consider using the xterm-xf86-v32 (or later, the most recent
307         version is always named "xterm-xfree86") entry, which adds ANSI color
308         and the VT220 capabilities which have been added in XFree86.  If you
309         are running a mixed network, however, where this terminal description
310         may be used on an older xterm, you may have problems, since
311         applications that assume these capabilities will produce incorrect
312         output on the older xterm (e.g., highlighting is not cleared).
313
314 CONFIGURING FALLBACK ENTRIES
315         In order to support operation of ncurses programs before the terminfo
316         tree is accessible (that is, in single-user mode or at OS installation
317         time) the ncurses library can be compiled to include an array of
318         pre-fetched fallback entries.
319
320         These entries are checked by setupterm() only when the conventional
321         fetches from the terminfo tree and the termcap fallback (if configured)
322         have been tried and failed.  Thus, the presence of a fallback will not
323         shadow modifications to the on-disk entry for the same type, when that
324         entry is accessible.
325
326         By default, there are no entries on the fallback list.  After you
327         have built the ncurses suite for the first time, you can change
328         the list (the process needs infocmp(1)).  To do so, use the script
329         MKfallback.sh.  A configure script option --with-fallbacks does this
330         (it accepts a comma-separated list of the names you wish, and does
331         not require a rebuild).
332
333         If you wanted (say) to have linux, vt100, and xterm fallbacks, you
334         would use the commands
335
336                 cd ncurses;
337                 MKfallback.sh linux vt100 xterm >fallback.c
338
339         Then just rebuild and reinstall the library as you would normally.
340         You can restore the default empty fallback list with
341
342                 MKfallback.sh >fallback.c
343
344         The overhead for an empty fallback list is one trivial stub function.
345         Any non-empty fallback list is const-ed and therefore lives in sharable
346         text space.  You can look at the comment trailing each initializer in
347         the generated ncurses/fallback.c file to see the core cost of the
348         fallbacks.  A good rule of thumb for modern vt100-like entries is that
349         each one will cost about 2.5K of text space.
350
351 BSD CONVERSION NOTES:
352         If you need to support really ancient BSD programs, you probably
353         want to configure with the --enable-bsdpad option.  What this does
354         is enable code in tputs() that recognizes a numeric prefix on a
355         capability as a request for that much trailing padding in milliseconds.
356         There are old BSD programs that do things like tputs("50").
357
358         (If you are distributing ncurses as a support-library component of
359         an application you probably want to put the remainder of this section
360         in the package README file.)
361
362         The following note applies only if you have configured ncurses with
363         --enable-termcap.
364
365 ------------------------------- CUT HERE --------------------------------
366
367 If you are installing this application privately (either because you
368 have no root access or want to experiment with it before doing a root
369 installation), there are a couple of details you need to be aware of.
370 They have to do with the ncurses library, which uses terminfo rather
371 than termcap for describing terminal characteristics.
372
373 Though the ncurses library is terminfo-based, it will interpret your
374 TERMCAP variable (if present), any local termcap files you reference
375 through it, and the system termcap file.  However, in order to avoid
376 slowing down your application startup, it will only do this once per
377 terminal type!
378
379 The first time you load a given terminal type from your termcap
380 database, the library initialization code will automatically write it
381 in terminfo format to a subdirectory under $HOME/.terminfo.  After
382 that, the initialization code will find it there and do a (much
383 faster) terminfo fetch.
384
385 Usually, all this means is that your home directory will silently grow
386 an invisible .terminfo subdirectory which will get filled in with
387 terminfo descriptions of terminal types as you invoke them.  If anyone
388 ever installs a global terminfo tree on your system, this will quietly
389 stop happening and your $HOME/.terminfo will become redundant.
390
391 The objective of all this logic is to make converting from BSD termcap
392 as painless as possible without slowing down your application (termcap
393 compilation is expensive).
394
395 If you don't have a TERMCAP variable or custom personal termcap file,
396 you can skip the rest of this dissertation.
397
398 If you *do* have a TERMCAP variable and/or a custom personal termcap file
399 that defines a terminal type, that definition will stop being visible
400 to this application after the first time you run it, because it will
401 instead see the terminfo entry that it wrote to $HOME/terminfo the
402 first time around.
403
404 Subsequently, editing the TERMCAP variable or personal TERMCAP file
405 will have no effect unless you explicitly remove the terminfo entry
406 under $HOME/terminfo.  If you do that, the entry will be recompiled
407 from your termcap resources the next time it is invoked.
408
409 To avoid these complications, use infocmp(1) and tic(1) to edit the
410 terminfo directory directly.
411
412 ------------------------------- CUT HERE --------------------------------
413
414 USING NCURSES WITH AFS:
415         AFS treats each directory as a separate logical filesystem, you
416         can't hard-link across them.  The --enable-symlinks option copes
417         with this by making tic use symbolic links.
418
419 USING NCURSES WITH EMACS:
420         GNU Emacs has its own termcap support.  By default, it uses a mixture
421         of those functions and code linked from the host system's libraries.
422         You need to foil this and shut out the GNU termcap library entirely.
423
424         In order to do this, hack the Linux config file (s/linux.h) to contain
425         a #define TERMINFO and set the symbol LIBS_TERMCAP to "-lncurses".
426
427         We have submitted such a change for the 19.30 release, so it may
428         already be applied in your sources -- check for the #define TERMINFO.
429
430 USING NCURSES WITH GPM:
431         Ncurses 4.1 and up can be configured to use GPM (General Purpose Mouse)
432         which is used on Linux console.  Be aware that GPM is commonly
433         installed as a shared library which contains a wrapper for the curses
434         wgetch() function (libcurses.o).  Some integrators have simplified
435         linking applications by combining all of libcurses.so (the BSD curses)
436         into the libgpm.so file, producing symbol conflicts with ncurses.  You
437         may be able to work around this problem by linking as follows:
438
439                 cc -o foo foo.o -lncurses -lgpm -lncurses
440
441         but the linker may not cooperate, producing mysterious errors.
442         A patched version of gpm is available:
443
444                 ftp.clark.net:/pub/dickey/ncurses/gpm-1.10-970125.tgz
445
446         This patch is incorporated in gpm 1.12; however some integrators
447         are slow to update this library.
448
449 USING NCURSES WITH ELVIS:
450         To use ncurses as the screen-painting library for Elvis, apply the
451         following patch to the Elvis curses
452
453 *** curses.c.orig       Sun Jun 26 05:48:23 1994
454 --- curses.c    Sun Feb 11 16:50:41 1996
455 ***************
456 *** 986,992 ****
457   {
458         if (has_IM)
459                 do_IM();
460 !       do_IC();
461         qaddch(ch);
462         if (has_EI)
463                 do_EI();
464 --- 986,995 ----
465   {
466         if (has_IM)
467                 do_IM();
468 !#ifdef NCURSES_VERSION
469 !       else    /* ncurses does insertion in a slightly nonstandard way */
470 !#endif
471 !               do_IC();
472         qaddch(ch);
473         if (has_EI)
474                 do_EI();
475
476 This patch is for elvis-1.8pl4 but it can even be used for elvis-1.8pl3 with
477 an offset of -11 lines.
478
479 BUGS:
480         Send any feedback to the ncurses mailing list at
481         bug-ncurses@gnu.org. To subscribe send mail to 
482         bug-ncurses-request@gnu.org with body that reads: 
483         subscribe ncurses <your-email-address-here>
484
485         The Hacker's Guide in the misc directory includes some guidelines
486         on how to report bugs in ways that will get them fixed most quickly.