10e3d5408SPeter Wemm-- $Id: INSTALL,v 1.32 1999/07/24 21:06:24 tom Exp $ 20e3d5408SPeter Wemm--------------------------------------------------------------------- 30e3d5408SPeter Wemm How to install Ncurses/Terminfo on your system 40e3d5408SPeter Wemm--------------------------------------------------------------------- 50e3d5408SPeter Wemm ************************************************************ 60e3d5408SPeter Wemm * READ ALL OF THIS FILE BEFORE YOU TRY TO INSTALL NCURSES. * 70e3d5408SPeter Wemm ************************************************************ 80e3d5408SPeter Wemm 90e3d5408SPeter WemmYou should be reading the file INSTALL in a directory called ncurses-d.d, where 100e3d5408SPeter Wemmd.d is the current version number. There should be several subdirectories, 110e3d5408SPeter Wemmincluding `c++', `form', `man', `menu', 'misc', `ncurses', `panel', `progs', 120e3d5408SPeter Wemmand `test'. See the README file for a roadmap to the package. 130e3d5408SPeter Wemm 140e3d5408SPeter WemmIf you are a Linux or FreeBSD or NetBSD distribution integrator or packager, 150e3d5408SPeter Wemmplease read and act on the section titled IF YOU ARE A SYSTEM INTEGRATOR 160e3d5408SPeter Wemmbelow. 170e3d5408SPeter Wemm 180e3d5408SPeter WemmIf you are converting from BSD curses and do not have root access, be sure 190e3d5408SPeter Wemmto read the BSD CONVERSION NOTES section below. 200e3d5408SPeter Wemm 210e3d5408SPeter WemmIf you are using a version of XFree86 xterm older than 3.1.2F, see the section 220e3d5408SPeter Wemmon RECENT XTERM VERSIONS below. 230e3d5408SPeter Wemm 240e3d5408SPeter WemmIf you are trying to build GNU Emacs using ncurses for terminal support, 250e3d5408SPeter Wemmread the USING NCURSES WITH EMACS section below. 260e3d5408SPeter Wemm 270e3d5408SPeter WemmIf you are trying to build applications using gpm with ncurses, 280e3d5408SPeter Wemmread the USING NCURSES WITH GPM section below. 290e3d5408SPeter Wemm 300e3d5408SPeter WemmIf you are trying to build Elvis using ncurses for terminal support, 310e3d5408SPeter Wemmread the USING NCURSES WITH ELVIS section below. 320e3d5408SPeter Wemm 330e3d5408SPeter WemmIf you are running over the Andrew File System see the note below on 340e3d5408SPeter WemmUSING NCURSES WITH AFS. 350e3d5408SPeter Wemm 360e3d5408SPeter WemmIf you want to build the Ada95 binding, go to the Ada95 directory and 370e3d5408SPeter Wemmfollow the instructions there. The Ada95 binding is not covered below. 380e3d5408SPeter Wemm 390e3d5408SPeter WemmIf you are using anything but (a) Linux, or (b) one of the 4.4BSD-based 400e3d5408SPeter Wemmi386 Unixes, go read the Portability section in the TO-DO file before you 410e3d5408SPeter Wemmdo anything else. 420e3d5408SPeter Wemm 430e3d5408SPeter WemmREQUIREMENTS: 440e3d5408SPeter Wemm 450e3d5408SPeter WemmYou will need the following in order to build and install ncurses under UNIX: 460e3d5408SPeter Wemm 470e3d5408SPeter Wemm * ANSI C compiler (gcc is recommended) 480e3d5408SPeter Wemm * sh (bash will do) 490e3d5408SPeter Wemm * awk (mawk or gawk will do) 500e3d5408SPeter Wemm * sed 510e3d5408SPeter Wemm * BSD or System V style install (a script is enclosed) 520e3d5408SPeter Wemm 530e3d5408SPeter WemmNcurses has been also built in the OS/2 EMX environment. 540e3d5408SPeter Wemm 550e3d5408SPeter WemmINSTALLATION PROCEDURE: 560e3d5408SPeter Wemm 570e3d5408SPeter Wemm1. First, decide whether you want ncurses to replace your existing library (in 580e3d5408SPeter Wemm which case you'll need super-user privileges) or be installed in parallel 590e3d5408SPeter Wemm with it. 600e3d5408SPeter Wemm 610e3d5408SPeter Wemm The --prefix option to configure changes the root directory for installing 620e3d5408SPeter Wemm ncurses. The default is in subdirectories of /usr/local. Use 630e3d5408SPeter Wemm --prefix=/usr to replace your default curses distribution. This is the 640e3d5408SPeter Wemm default for Linux and BSD/OS users. 650e3d5408SPeter Wemm 660e3d5408SPeter Wemm The package gets installed beneath the --prefix directory as follows: 670e3d5408SPeter Wemm 680e3d5408SPeter Wemm In $(prefix)/bin: tic, infocmp, captoinfo, tset, 690e3d5408SPeter Wemm reset, clear, tput, toe 700e3d5408SPeter Wemm In $(prefix)/lib: libncurses*.* libcurses.a 710e3d5408SPeter Wemm In $(prefix)/share/terminfo: compiled terminal descriptions 720e3d5408SPeter Wemm In $(prefix)/include: C header files 730e3d5408SPeter Wemm Under $(prefix)/man: the manual pages 740e3d5408SPeter Wemm 750e3d5408SPeter Wemm Note however that the configure script attempts to locate previous 760e3d5408SPeter Wemm installation of ncurses, and will set the default prefix according to where 770e3d5408SPeter Wemm it finds the ncurses headers. 780e3d5408SPeter Wemm 790e3d5408SPeter Wemm2. Type `./configure' in the top-level directory of the distribution to 800e3d5408SPeter Wemm configure ncurses for your operating system and create the Makefiles. 810e3d5408SPeter Wemm Besides --prefix, various configuration options are available to customize 820e3d5408SPeter Wemm the installation; use `./configure --help' to list the available options. 830e3d5408SPeter Wemm 840e3d5408SPeter Wemm If your operating system is not supported, read the PORTABILITY section in 850e3d5408SPeter Wemm the file ncurses/README for information on how to create a configuration 860e3d5408SPeter Wemm file for your system. 870e3d5408SPeter Wemm 880e3d5408SPeter Wemm The `configure' script generates makefile rules for one or more object 890e3d5408SPeter Wemm models and their associated libraries: 900e3d5408SPeter Wemm 910e3d5408SPeter Wemm libncurses.a (normal) 920e3d5408SPeter Wemm 930e3d5408SPeter Wemm libcurses.a (normal, a link to libncurses.a) 940e3d5408SPeter Wemm This gets left out if you configure with --disable-overwrite. 950e3d5408SPeter Wemm 960e3d5408SPeter Wemm libncurses.so (shared) 970e3d5408SPeter Wemm 980e3d5408SPeter Wemm libncurses_g.a (debug) 990e3d5408SPeter Wemm 1000e3d5408SPeter Wemm libncurses_p.a (profile) 1010e3d5408SPeter Wemm 1020e3d5408SPeter Wemm If you do not specify any models, the normal and debug libraries will be 1030e3d5408SPeter Wemm configured. Typing `configure' with no arguments is equivalent to: 1040e3d5408SPeter Wemm 1050e3d5408SPeter Wemm ./configure --with-normal --with-debug --enable-overwrite 1060e3d5408SPeter Wemm 1070e3d5408SPeter Wemm Typing 1080e3d5408SPeter Wemm 1090e3d5408SPeter Wemm ./configure --with-shared 1100e3d5408SPeter Wemm 1110e3d5408SPeter Wemm makes the shared libraries the default, resulting in 1120e3d5408SPeter Wemm 1130e3d5408SPeter Wemm ./configure --with-shared --with-normal --with-debug --enable-overwrite 1140e3d5408SPeter Wemm 1150e3d5408SPeter Wemm If you want only shared libraries, type 1160e3d5408SPeter Wemm 1170e3d5408SPeter Wemm ./configure --with-shared --without-normal --without-debug 1180e3d5408SPeter Wemm 1190e3d5408SPeter Wemm Rules for generating shared libraries are highly dependent upon the choice 1200e3d5408SPeter Wemm of host system and compiler. We've been testing shared libraries on Linux 1210e3d5408SPeter Wemm and SunOS with gcc, but more work needs to be done to make shared libraries 1220e3d5408SPeter Wemm work on other systems. 1230e3d5408SPeter Wemm 1240e3d5408SPeter Wemm You can make curses and terminfo fall back to an existing file of termcap 1250e3d5408SPeter Wemm definitions by configuring with --enable-termcap. If you do this, the 1260e3d5408SPeter Wemm library will search /etc/termcap before the terminfo database, and will 1270e3d5408SPeter Wemm also interpret the contents of the TERM environment variable. See the 1280e3d5408SPeter Wemm section BSD CONVERSION NOTES below. 1290e3d5408SPeter Wemm 1300e3d5408SPeter Wemm3. Type `make'. Ignore any warnings, no error messages should be produced. 1310e3d5408SPeter Wemm This should compile the ncurses library, the terminfo compiler tic(1), 1320e3d5408SPeter Wemm captoinfo(1), infocmp(1), toe(1), clear(1) tset(1), reset(1), and tput(1) 1330e3d5408SPeter Wemm programs (see the man pages for explanation of what they do), some test 1340e3d5408SPeter Wemm programs, and the panels, menus, and forms libraries. 1350e3d5408SPeter Wemm 1360e3d5408SPeter Wemm4. Run ncurses and several other test programs in the test directory to 1370e3d5408SPeter Wemm verify that ncurses functions correctly before doing an install that 1380e3d5408SPeter Wemm may overwrite system files. Read the file test/README for details on 1390e3d5408SPeter Wemm the test programs. 1400e3d5408SPeter Wemm 1410e3d5408SPeter Wemm NOTE: You must have installed the terminfo database, or set the 1420e3d5408SPeter Wemm environment variable $TERMINFO to point to a SVr4-compatible terminfo 1430e3d5408SPeter Wemm database before running the test programs. Not all vendors' terminfo 1440e3d5408SPeter Wemm databases are SVr4-compatible, but most seem to be. Exceptions include 1450e3d5408SPeter Wemm DEC's Digital Unix (formerly known as OSF/1). 1460e3d5408SPeter Wemm 1470e3d5408SPeter Wemm The ncurses program is designed specifically to test the ncurses library. 1480e3d5408SPeter Wemm You can use it to verify that the screen highlights work correctly, that 1490e3d5408SPeter Wemm cursor addressing and window scrolling works OK, etc. 1500e3d5408SPeter Wemm 1510e3d5408SPeter Wemm5. Once you've tested, you can type `make install' to install libraries, 1520e3d5408SPeter Wemm the programs, the terminfo database and the man pages. Alternately, you 1530e3d5408SPeter Wemm can type `make install' in each directory you want to install. In the 1540e3d5408SPeter Wemm top-level directory, you can do a partial install using these commands: 1550e3d5408SPeter Wemm 1560e3d5408SPeter Wemm 'make install.progs' installs tic, infocmp, etc... 1570e3d5408SPeter Wemm 'make install.includes' installs the headers. 1580e3d5408SPeter Wemm 'make install.libs' installs the libraries (and the headers). 1590e3d5408SPeter Wemm 'make install.data' installs the terminfo data. (Note: `tic' must 1600e3d5408SPeter Wemm be installed before the terminfo data can be 1610e3d5408SPeter Wemm compiled). 1620e3d5408SPeter Wemm 'make install.man' installs the man pages. 1630e3d5408SPeter Wemm 1640e3d5408SPeter Wemm ############################################################################ 1650e3d5408SPeter Wemm # CAVEAT EMPTOR: `install.data' run as root will NUKE any existing # 1660e3d5408SPeter Wemm # terminfo database. If you have any custom or unusual entries SAVE them # 1670e3d5408SPeter Wemm # before you install ncurses. I have a file called terminfo.custom for # 1680e3d5408SPeter Wemm # this purpose. Don't forget to run tic on the file once you're done. # 1690e3d5408SPeter Wemm ############################################################################ 1700e3d5408SPeter Wemm 1710e3d5408SPeter Wemm The terminfo(5) manual page wants to be preprocessed with tbl(1) before 1720e3d5408SPeter Wemm being formatted by nroff(1). Modern man(1) implementations tend to do 1730e3d5408SPeter Wemm this by default, but you may want to look at your version's man page 1740e3d5408SPeter Wemm to be sure. 1750e3d5408SPeter Wemm 1760e3d5408SPeter Wemm If the system already has a curses library that you need to keep using 1770e3d5408SPeter Wemm for some bizarre binary-compatibility reason, you'll need to distinguish 1780e3d5408SPeter Wemm between it and ncurses. If ncurses is installed outside the standard 1790e3d5408SPeter Wemm directories (/usr/include and /usr/lib) then all your users will need 1800e3d5408SPeter Wemm to use the -I option to compile programs and -L to link them. 1810e3d5408SPeter Wemm 1820e3d5408SPeter Wemm If you have BSD curses installed in your system and you accidentally 1830e3d5408SPeter Wemm compile using its curses.h you'll end up with a large number of 1840e3d5408SPeter Wemm undefined symbols at link time. _waddbytes is one of them. 1850e3d5408SPeter Wemm 1860e3d5408SPeter Wemm IF YOU DO NOT HAVE ROOT: Change directory to the `progs' subdirectory 1870e3d5408SPeter Wemm and run the `capconvert' script. This script will deduce various things 1880e3d5408SPeter Wemm about your environment and use them to build you a private terminfo tree, 1890e3d5408SPeter Wemm so you can use ncurses applications. 1900e3d5408SPeter Wemm 1910e3d5408SPeter Wemm If more than one user at your site does this, the space for the duplicate 1920e3d5408SPeter Wemm trees is wasted. Try to get your site administrators to install a system- 1930e3d5408SPeter Wemm wide terminfo tree instead. 1940e3d5408SPeter Wemm 1950e3d5408SPeter Wemm See the BSD CONVERSION NOTES section below for a few more details. 1960e3d5408SPeter Wemm 1970e3d5408SPeter Wemm6. The c++ directory has C++ classes that are built on top of ncurses and 1980e3d5408SPeter Wemm panels. You need to have c++ (and its libraries) installed before you can 1990e3d5408SPeter Wemm compile and run the demo. 2000e3d5408SPeter Wemm 2010e3d5408SPeter Wemm If you do not have C++, you must use the --without-cxx option to tell 2020e3d5408SPeter Wemm the configure script to not attempt to build the C++ bindings. 2030e3d5408SPeter Wemm 2040e3d5408SPeter Wemm7. If you're running an older Linux, you must either (a) tell Linux that the 2050e3d5408SPeter Wemm console terminal type is `linux' or (b) make a link to or copy of the 2060e3d5408SPeter Wemm linux entry in the appropriate place under your terminfo directory, named 2070e3d5408SPeter Wemm `console'. All 1.3 and many 1.2 distributions (including Yggdrasil and 2080e3d5408SPeter Wemm Red Hat) already have the console type set to `linux'. 2090e3d5408SPeter Wemm 2100e3d5408SPeter Wemm The way to change the wired-in console type depends on the configuration 2110e3d5408SPeter Wemm of your system. This may involve editing /etc/inittab, /etc/ttytype, 2120e3d5408SPeter Wemm /etc/profile and other such files. 2130e3d5408SPeter Wemm 2140e3d5408SPeter Wemm Warning: this is not for the fainthearted, if you mess up your console 2150e3d5408SPeter Wemm getty entries you can make your system unusable! However, if you are 2160e3d5408SPeter Wemm a distribution maker, this is the right thing to do (see the note for 2170e3d5408SPeter Wemm integrators near the end of this file). 2180e3d5408SPeter Wemm 2190e3d5408SPeter Wemm The easier way is to link or copy l/linux to c/console under your terminfo 2200e3d5408SPeter Wemm directory. Note: this will go away next time you do `make install.data' 2210e3d5408SPeter Wemm and you'll have to redo it. There is no need to have entries for all 2220e3d5408SPeter Wemm possible screen sizes, ncurses will figure out the size automatically. 2230e3d5408SPeter Wemm 2240e3d5408SPeter WemmIF YOU ARE A SYSTEM INTEGRATOR: 2250e3d5408SPeter Wemm 2260e3d5408SPeter Wemm Beginning with 1.9.9, the ncurses distribution includes both a tset 2270e3d5408SPeter Wemm utility and /usr/share/tabset directory. If you are installing ncurses, 2280e3d5408SPeter Wemm it is no longer either necessary or desirable to install tset-jv. 2290e3d5408SPeter Wemm 2300e3d5408SPeter Wemm Configuration and Installation: 2310e3d5408SPeter Wemm 2320e3d5408SPeter Wemm Configure with --prefix=/usr to make the install productions put 2330e3d5408SPeter Wemm libraries and headers in the correct locations (overwriting any 2340e3d5408SPeter Wemm previous curses libraries and headers). This will put the terminfo 2350e3d5408SPeter Wemm hierarchy under /usr/share/terminfo; you may want to override this with 2360e3d5408SPeter Wemm --datadir=/usr/share/misc; terminfo and tabset are installed under the 2370e3d5408SPeter Wemm data directory. 2380e3d5408SPeter Wemm 2390e3d5408SPeter Wemm Please configure the ncurses library in a pure-terminfo mode; that 2400e3d5408SPeter Wemm is, with the --disable-termcap option. This will make the ncurses 2410e3d5408SPeter Wemm library smaller and faster. The ncurses library includes a termcap 2420e3d5408SPeter Wemm emulation that queries the terminfo database, so even applications 2430e3d5408SPeter Wemm that use raw termcap to query terminal characteristics will win 2440e3d5408SPeter Wemm (providing you recompile and relink them!). 2450e3d5408SPeter Wemm 2460e3d5408SPeter Wemm If you must configure with termcap fallback enabled, you may also 2470e3d5408SPeter Wemm wish to use the --enable-getcap option. This option speeds up 2480e3d5408SPeter Wemm termcap-based startups, at the expense of not allowing personal 2490e3d5408SPeter Wemm termcap entries to reference the terminfo tree. See the code in 2500e3d5408SPeter Wemm ncurses/tinfo/read_termcap.c for details. 2510e3d5408SPeter Wemm 2520e3d5408SPeter Wemm Note that if you have $TERMCAP set, ncurses will use that value 2530e3d5408SPeter Wemm to locate termcap data. In particular, running from xterm will 2540e3d5408SPeter Wemm set $TERMCAP to the contents of the xterm's termcap entry. 2550e3d5408SPeter Wemm If ncurses sees that, it will not examine /etc/termcap. 2560e3d5408SPeter Wemm 2570e3d5408SPeter Wemm Keyboard Mapping: 2580e3d5408SPeter Wemm 2590e3d5408SPeter Wemm The terminfo file assumes that Shift-Tab generates \E[Z (the ECMA-48 2600e3d5408SPeter Wemm reverse-tabulation sequence) rather than ^I. Here are the loadkeys -d 2610e3d5408SPeter Wemm mappings that will set this up: 2620e3d5408SPeter Wemm 2630e3d5408SPeter Wemm keycode 15 = Tab Tab 2640e3d5408SPeter Wemm alt keycode 15 = Meta_Tab 2650e3d5408SPeter Wemm shift keycode 15 = F26 2660e3d5408SPeter Wemm string F26 ="\033[Z" 2670e3d5408SPeter Wemm 2680e3d5408SPeter Wemm Naming the Console Terminal 2690e3d5408SPeter Wemm 2700e3d5408SPeter Wemm In various Linuxes (and possibly elsewhere) there has been a practice 2710e3d5408SPeter Wemm of designating the system console driver type as `console'. Please 2720e3d5408SPeter Wemm do not do this any more! It complicates peoples' lives, because it 2730e3d5408SPeter Wemm can mean that several different terminfo entries from different 2740e3d5408SPeter Wemm operating systems all logically want to be called `console'. 2750e3d5408SPeter Wemm 2760e3d5408SPeter Wemm Please pick a name unique to your console driver and set that up 2770e3d5408SPeter Wemm in the /etc/inittab table or local equivalent. Send the entry to the 2780e3d5408SPeter Wemm terminfo maintainer (listed in the misc/terminfo file) to be included 2790e3d5408SPeter Wemm in the terminfo file, if it's not already there. See the 2800e3d5408SPeter Wemm term(7) manual page included with this distribution for more on 2810e3d5408SPeter Wemm conventions for choosing type names. 2820e3d5408SPeter Wemm 2830e3d5408SPeter Wemm Here are some recommended primary console names: 2840e3d5408SPeter Wemm 2850e3d5408SPeter Wemm linux -- Linux console driver 2860e3d5408SPeter Wemm freebsd -- FreeBSD 2870e3d5408SPeter Wemm netbsd -- NetBSD 2880e3d5408SPeter Wemm bsdos -- BSD/OS 2890e3d5408SPeter Wemm 2900e3d5408SPeter Wemm If you are responsible for integrating ncurses for one of these 2910e3d5408SPeter Wemm distribution, please either use the recommended name or get back 2920e3d5408SPeter Wemm to us explaining why you don't want to, so we can work out nomenclature 2930e3d5408SPeter Wemm that will make users' lives easier rather than harder. 2940e3d5408SPeter Wemm 2950e3d5408SPeter WemmRECENT XTERM VERSIONS 2960e3d5408SPeter Wemm The terminfo database file included with this distribution assumes you 2970e3d5408SPeter Wemm are running an XFree86 xterm based on X11R6 (i.e., xterm-r6). The 2980e3d5408SPeter Wemm earlier X11R5 entry (xterm-r5) is provided as well. 2990e3d5408SPeter Wemm 3000e3d5408SPeter Wemm If you are running XFree86 version 3.2 (actually 3.1.2F and up), you 3010e3d5408SPeter Wemm should consider using the xterm-xf86-v32 (or later, the most recent 3020e3d5408SPeter Wemm version is always named "xterm-xfree86") entry, which adds ANSI color 3030e3d5408SPeter Wemm and the VT220 capabilities which have been added in XFree86. If you 3040e3d5408SPeter Wemm are running a mixed network, however, where this terminal description 3050e3d5408SPeter Wemm may be used on an older xterm, you may have problems, since 3060e3d5408SPeter Wemm applications that assume these capabilities will produce incorrect 3070e3d5408SPeter Wemm output on the older xterm (e.g., highlighting is not cleared). 3080e3d5408SPeter Wemm 3090e3d5408SPeter WemmCONFIGURING FALLBACK ENTRIES 3100e3d5408SPeter Wemm In order to support operation of ncurses programs before the terminfo 3110e3d5408SPeter Wemm tree is accessible (that is, in single-user mode or at OS installation 3120e3d5408SPeter Wemm time) the ncurses library can be compiled to include an array of 3130e3d5408SPeter Wemm pre-fetched fallback entries. 3140e3d5408SPeter Wemm 3150e3d5408SPeter Wemm These entries are checked by setupterm() only when the conventional 3160e3d5408SPeter Wemm fetches from the terminfo tree and the termcap fallback (if configured) 3170e3d5408SPeter Wemm have been tried and failed. Thus, the presence of a fallback will not 3180e3d5408SPeter Wemm shadow modifications to the on-disk entry for the same type, when that 3190e3d5408SPeter Wemm entry is accessible. 3200e3d5408SPeter Wemm 3210e3d5408SPeter Wemm By default, there are no entries on the fallback list. After you 3220e3d5408SPeter Wemm have built the ncurses suite for the first time, you can change 3230e3d5408SPeter Wemm the list (the process needs infocmp(1)). To do so, use the script 3240e3d5408SPeter Wemm MKfallback.sh. A configure script option --with-fallbacks does this 3250e3d5408SPeter Wemm (it accepts a comma-separated list of the names you wish, and does 3260e3d5408SPeter Wemm not require a rebuild). 3270e3d5408SPeter Wemm 3280e3d5408SPeter Wemm If you wanted (say) to have linux, vt100, and xterm fallbacks, you 3290e3d5408SPeter Wemm would use the commands 3300e3d5408SPeter Wemm 3310e3d5408SPeter Wemm cd ncurses; 3320e3d5408SPeter Wemm MKfallback.sh linux vt100 xterm >fallback.c 3330e3d5408SPeter Wemm 3340e3d5408SPeter Wemm Then just rebuild and reinstall the library as you would normally. 3350e3d5408SPeter Wemm You can restore the default empty fallback list with 3360e3d5408SPeter Wemm 3370e3d5408SPeter Wemm MKfallback.sh >fallback.c 3380e3d5408SPeter Wemm 3390e3d5408SPeter Wemm The overhead for an empty fallback list is one trivial stub function. 3400e3d5408SPeter Wemm Any non-empty fallback list is const-ed and therefore lives in sharable 3410e3d5408SPeter Wemm text space. You can look at the comment trailing each initializer in 3420e3d5408SPeter Wemm the generated ncurses/fallback.c file to see the core cost of the 3430e3d5408SPeter Wemm fallbacks. A good rule of thumb for modern vt100-like entries is that 3440e3d5408SPeter Wemm each one will cost about 2.5K of text space. 3450e3d5408SPeter Wemm 3460e3d5408SPeter WemmBSD CONVERSION NOTES: 3470e3d5408SPeter Wemm If you need to support really ancient BSD programs, you probably 3480e3d5408SPeter Wemm want to configure with the --enable-bsdpad option. What this does 3490e3d5408SPeter Wemm is enable code in tputs() that recognizes a numeric prefix on a 3500e3d5408SPeter Wemm capability as a request for that much trailing padding in milliseconds. 3510e3d5408SPeter Wemm There are old BSD programs that do things like tputs("50"). 3520e3d5408SPeter Wemm 3530e3d5408SPeter Wemm (If you are distributing ncurses as a support-library component of 3540e3d5408SPeter Wemm an application you probably want to put the remainder of this section 3550e3d5408SPeter Wemm in the package README file.) 3560e3d5408SPeter Wemm 3570e3d5408SPeter Wemm The following note applies only if you have configured ncurses with 3580e3d5408SPeter Wemm --enable-termcap. 3590e3d5408SPeter Wemm 3600e3d5408SPeter Wemm------------------------------- CUT HERE -------------------------------- 3610e3d5408SPeter Wemm 3620e3d5408SPeter WemmIf you are installing this application privately (either because you 3630e3d5408SPeter Wemmhave no root access or want to experiment with it before doing a root 3640e3d5408SPeter Wemminstallation), there are a couple of details you need to be aware of. 3650e3d5408SPeter WemmThey have to do with the ncurses library, which uses terminfo rather 3660e3d5408SPeter Wemmthan termcap for describing terminal characteristics. 3670e3d5408SPeter Wemm 3680e3d5408SPeter WemmThough the ncurses library is terminfo-based, it will interpret your 3690e3d5408SPeter WemmTERMCAP variable (if present), any local termcap files you reference 3700e3d5408SPeter Wemmthrough it, and the system termcap file. However, in order to avoid 3710e3d5408SPeter Wemmslowing down your application startup, it will only do this once per 3720e3d5408SPeter Wemmterminal type! 3730e3d5408SPeter Wemm 3740e3d5408SPeter WemmThe first time you load a given terminal type from your termcap 3750e3d5408SPeter Wemmdatabase, the library initialization code will automatically write it 3760e3d5408SPeter Wemmin terminfo format to a subdirectory under $HOME/.terminfo. After 3770e3d5408SPeter Wemmthat, the initialization code will find it there and do a (much 3780e3d5408SPeter Wemmfaster) terminfo fetch. 3790e3d5408SPeter Wemm 3800e3d5408SPeter WemmUsually, all this means is that your home directory will silently grow 3810e3d5408SPeter Wemman invisible .terminfo subdirectory which will get filled in with 3820e3d5408SPeter Wemmterminfo descriptions of terminal types as you invoke them. If anyone 3830e3d5408SPeter Wemmever installs a global terminfo tree on your system, this will quietly 3840e3d5408SPeter Wemmstop happening and your $HOME/.terminfo will become redundant. 3850e3d5408SPeter Wemm 3860e3d5408SPeter WemmThe objective of all this logic is to make converting from BSD termcap 3870e3d5408SPeter Wemmas painless as possible without slowing down your application (termcap 3880e3d5408SPeter Wemmcompilation is expensive). 3890e3d5408SPeter Wemm 3900e3d5408SPeter WemmIf you don't have a TERMCAP variable or custom personal termcap file, 3910e3d5408SPeter Wemmyou can skip the rest of this dissertation. 3920e3d5408SPeter Wemm 3930e3d5408SPeter WemmIf you *do* have a TERMCAP variable and/or a custom personal termcap file 3940e3d5408SPeter Wemmthat defines a terminal type, that definition will stop being visible 3950e3d5408SPeter Wemmto this application after the first time you run it, because it will 3960e3d5408SPeter Wemminstead see the terminfo entry that it wrote to $HOME/terminfo the 3970e3d5408SPeter Wemmfirst time around. 3980e3d5408SPeter Wemm 3990e3d5408SPeter WemmSubsequently, editing the TERMCAP variable or personal TERMCAP file 4000e3d5408SPeter Wemmwill have no effect unless you explicitly remove the terminfo entry 4010e3d5408SPeter Wemmunder $HOME/terminfo. If you do that, the entry will be recompiled 4020e3d5408SPeter Wemmfrom your termcap resources the next time it is invoked. 4030e3d5408SPeter Wemm 4040e3d5408SPeter WemmTo avoid these complications, use infocmp(1) and tic(1) to edit the 4050e3d5408SPeter Wemmterminfo directory directly. 4060e3d5408SPeter Wemm 4070e3d5408SPeter Wemm------------------------------- CUT HERE -------------------------------- 4080e3d5408SPeter Wemm 4090e3d5408SPeter WemmUSING NCURSES WITH AFS: 4100e3d5408SPeter Wemm AFS treats each directory as a separate logical filesystem, you 4110e3d5408SPeter Wemm can't hard-link across them. The --enable-symlinks option copes 4120e3d5408SPeter Wemm with this by making tic use symbolic links. 4130e3d5408SPeter Wemm 4140e3d5408SPeter WemmUSING NCURSES WITH EMACS: 4150e3d5408SPeter Wemm GNU Emacs has its own termcap support. By default, it uses a mixture 4160e3d5408SPeter Wemm of those functions and code linked from the host system's libraries. 4170e3d5408SPeter Wemm You need to foil this and shut out the GNU termcap library entirely. 4180e3d5408SPeter Wemm 4190e3d5408SPeter Wemm In order to do this, hack the Linux config file (s/linux.h) to contain 4200e3d5408SPeter Wemm a #define TERMINFO and set the symbol LIBS_TERMCAP to "-lncurses". 4210e3d5408SPeter Wemm 4220e3d5408SPeter Wemm We have submitted such a change for the 19.30 release, so it may 4230e3d5408SPeter Wemm already be applied in your sources -- check for the #define TERMINFO. 4240e3d5408SPeter Wemm 4250e3d5408SPeter WemmUSING NCURSES WITH GPM: 4260e3d5408SPeter Wemm Ncurses 4.1 and up can be configured to use GPM (General Purpose Mouse) 4270e3d5408SPeter Wemm which is used on Linux console. Be aware that GPM is commonly 4280e3d5408SPeter Wemm installed as a shared library which contains a wrapper for the curses 4290e3d5408SPeter Wemm wgetch() function (libcurses.o). Some integrators have simplified 4300e3d5408SPeter Wemm linking applications by combining all of libcurses.so (the BSD curses) 4310e3d5408SPeter Wemm into the libgpm.so file, producing symbol conflicts with ncurses. You 4320e3d5408SPeter Wemm may be able to work around this problem by linking as follows: 4330e3d5408SPeter Wemm 4340e3d5408SPeter Wemm cc -o foo foo.o -lncurses -lgpm -lncurses 4350e3d5408SPeter Wemm 4360e3d5408SPeter Wemm but the linker may not cooperate, producing mysterious errors. 4370e3d5408SPeter Wemm A patched version of gpm is available: 4380e3d5408SPeter Wemm 4390e3d5408SPeter Wemm ftp.clark.net:/pub/dickey/ncurses/gpm-1.10-970125.tgz 4400e3d5408SPeter Wemm 4410e3d5408SPeter Wemm This patch is incorporated in gpm 1.12; however some integrators 4420e3d5408SPeter Wemm are slow to update this library. 4430e3d5408SPeter Wemm 4440e3d5408SPeter WemmUSING NCURSES WITH ELVIS: 4450e3d5408SPeter Wemm To use ncurses as the screen-painting library for Elvis, apply the 4460e3d5408SPeter Wemm following patch to the Elvis curses 4470e3d5408SPeter Wemm 4480e3d5408SPeter Wemm*** curses.c.orig Sun Jun 26 05:48:23 1994 4490e3d5408SPeter Wemm--- curses.c Sun Feb 11 16:50:41 1996 4500e3d5408SPeter Wemm*************** 4510e3d5408SPeter Wemm*** 986,992 **** 4520e3d5408SPeter Wemm { 4530e3d5408SPeter Wemm if (has_IM) 4540e3d5408SPeter Wemm do_IM(); 4550e3d5408SPeter Wemm! do_IC(); 4560e3d5408SPeter Wemm qaddch(ch); 4570e3d5408SPeter Wemm if (has_EI) 4580e3d5408SPeter Wemm do_EI(); 4590e3d5408SPeter Wemm--- 986,995 ---- 4600e3d5408SPeter Wemm { 4610e3d5408SPeter Wemm if (has_IM) 4620e3d5408SPeter Wemm do_IM(); 4630e3d5408SPeter Wemm!#ifdef NCURSES_VERSION 4640e3d5408SPeter Wemm! else /* ncurses does insertion in a slightly nonstandard way */ 4650e3d5408SPeter Wemm!#endif 4660e3d5408SPeter Wemm! do_IC(); 4670e3d5408SPeter Wemm qaddch(ch); 4680e3d5408SPeter Wemm if (has_EI) 4690e3d5408SPeter Wemm do_EI(); 4700e3d5408SPeter Wemm 4710e3d5408SPeter WemmThis patch is for elvis-1.8pl4 but it can even be used for elvis-1.8pl3 with 4720e3d5408SPeter Wemman offset of -11 lines. 4730e3d5408SPeter Wemm 4740e3d5408SPeter WemmBUGS: 4750e3d5408SPeter Wemm Send any feedback to the ncurses mailing list at 4760e3d5408SPeter Wemm bug-ncurses@gnu.org. To subscribe send mail to 4770e3d5408SPeter Wemm bug-ncurses-request@gnu.org with body that reads: 4780e3d5408SPeter Wemm subscribe ncurses <your-email-address-here> 4790e3d5408SPeter Wemm 4800e3d5408SPeter Wemm The Hacker's Guide in the misc directory includes some guidelines 4810e3d5408SPeter Wemm on how to report bugs in ways that will get them fixed most quickly. 482