]> ncurses.scripts.mit.edu Git - ncurses.git/blob - INSTALL
ncurses 4.2
[ncurses.git] / INSTALL
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     ************************************************************
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 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
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'.
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
224 IF 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/read_termcap.c for details.
251
252     Keyboard Mapping:
253
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:
257
258                 keycode  15 = Tab             Tab
259                         alt     keycode  15 = Meta_Tab
260                         shift   keycode  15 = F26
261                 string F26 ="\033[Z"
262
263     Naming the Console Terminal
264
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'.
270
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.
277
278         Here are our recommended primary console names for the most important
279         freeware UNIX distributions:
280
281                 linux   -- Linux console driver
282                 freebsd -- FreeBSD
283                 netbsd  -- NetBSD
284                 bsdos   -- BSD/OS
285
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.
290
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.
295
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).
303
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.
309
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
314         entry is accessible.
315
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).
322
323         If you wanted (say) to have linux, vt100, and xterm fallbacks, you
324         would use the commands
325
326                 cd ncurses;
327                 MKfallback.sh linux vt100 xterm >fallback.c
328
329         Then just rebuild and reinstall the library as you would normally.
330         You can restore the default empty fallback list with
331
332                 MKfallback.sh >fallback.c
333
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.
340
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").
347
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.)
351
352         The following note applies only if you have configured ncurses with
353         --enable-termcap.
354
355 ------------------------------- CUT HERE --------------------------------
356
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.
362
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
367 terminal type!
368
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.
374
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.
380
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).
384
385 If you don't have a TERMCAP variable or custom personal termcap file,
386 you can skip the rest of this dissertation.
387
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
392 first time around.
393
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.
398
399 To avoid these complications, use infocmp(1) and tic(1) to edit the
400 terminfo directory directly.
401
402 ------------------------------- CUT HERE --------------------------------
403
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.
408
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.
413
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".
416
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.
419
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:
428
429                 cc -o foo foo.o -lncurses -lgpm -lncurses
430
431         but the linker may not cooperate, producing mysterious errors.
432         A patched version of gpm is available:
433
434                 ftp.clark.net:/pub/dickey/ncurses/gpm-1.10-970125.tgz
435
436         This patch is incorporated in gpm 1.12; however some integrators
437         are slow to update this library.
438
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
442
443 *** curses.c.orig       Sun Jun 26 05:48:23 1994
444 --- curses.c    Sun Feb 11 16:50:41 1996
445 ***************
446 *** 986,992 ****
447   {
448         if (has_IM)
449                 do_IM();
450 !       do_IC();
451         qaddch(ch);
452         if (has_EI)
453                 do_EI();
454 --- 986,995 ----
455   {
456         if (has_IM)
457                 do_IM();
458 !#ifdef NCURSES_VERSION
459 !       else    /* ncurses does insertion in a slightly nonstandard way */
460 !#endif
461 !               do_IC();
462         qaddch(ch);
463         if (has_EI)
464                 do_EI();
465
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.
468
469 BUGS:
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>
474
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.