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