ncurses.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
  4. <!ENTITY % general-entities SYSTEM "../general.ent">
  5. %general-entities;
  6. ]>
  7. <sect1 id="ch-system-ncurses" role="wrap">
  8. <?dbhtml filename="ncurses.html"?>
  9. <title>Ncurses-&ncurses-version;</title>
  10. <indexterm zone="ch-system-ncurses">
  11. <primary sortas="a-Ncurses">Ncurses</primary>
  12. </indexterm>
  13. <sect2 role="package">
  14. <title/>
  15. <para>The Ncurses package contains libraries for terminal-independent
  16. handling of character screens.</para>
  17. <segmentedlist>
  18. <segtitle>&buildtime;</segtitle>
  19. <segtitle>&diskspace;</segtitle>
  20. <seglistitem>
  21. <seg>0.6 SBU</seg>
  22. <seg>18.6 MB</seg>
  23. </seglistitem>
  24. </segmentedlist>
  25. <segmentedlist>
  26. <segtitle>&dependencies;</segtitle>
  27. <seglistitem>
  28. <seg>Bash, Binutils, Coreutils, Diffutils, Gawk, GCC, Glibc, Grep,
  29. Make, and Sed</seg>
  30. </seglistitem>
  31. </segmentedlist>
  32. </sect2>
  33. <sect2 role="installation">
  34. <title>Installation of Ncurses</title>
  35. <!-- Uncomment if using a dated ncurses release instead of a numbered one.
  36. <para>Since the release of Ncurses-&ncurses-version;, some bugs have been fixed
  37. and features added. The most important news are .......
  38. To get these fixes and features, apply the rollup patch:</para>
  39. <screen><userinput>bzcat ../&ncurses-rollup-patch; | patch -Np1</userinput></screen>
  40. -->
  41. <para>Since the release of Ncurses-&ncurses-version;, a memory leak and some
  42. display bugs were found and fixed upstream. Apply those fixes:</para>
  43. <screen><userinput>patch -Np1 -i ../&ncurses-fixes-patch;</userinput></screen>
  44. <para>Prepare Ncurses for compilation:</para>
  45. <screen><userinput>./configure --prefix=/usr --with-shared --without-debug --enable-widec</userinput></screen>
  46. <variablelist>
  47. <title>The meaning of the configure option:</title>
  48. <varlistentry>
  49. <term><parameter>--enable-widec</parameter></term>
  50. <listitem>
  51. <para>This switch causes wide-character libraries (e.g., <filename
  52. class="libraryfile">libncursesw.so.&ncurses-version;</filename>)
  53. to be built instead of normal ones (e.g., <filename
  54. class="libraryfile">libncurses.so.&ncurses-version;</filename>).
  55. These wide-character libraries are usable in both multibyte and
  56. traditional 8-bit locales, while normal libraries work properly
  57. only in 8-bit locales. Wide-character and normal libraries are
  58. source-compatible, but not binary-compatible.</para>
  59. </listitem>
  60. </varlistentry>
  61. <!--
  62. <varlistentry>
  63. <term><parameter>- -without-cxx-binding</parameter></term>
  64. <listitem>
  65. <para>This optional switch causes the
  66. <filename class="libraryfile">libncurses++w.a</filename> library
  67. not to be built. Nothing in LFS and BLFS uses this library.</para>
  68. </listitem>
  69. </varlistentry>
  70. -->
  71. </variablelist>
  72. <para>Compile the package:</para>
  73. <screen><userinput>make</userinput></screen>
  74. <para>This package does not come with a test suite.</para>
  75. <para>Install the package:</para>
  76. <screen><userinput>make install</userinput></screen>
  77. <para>Give the Ncurses libraries execute permissions:</para>
  78. <screen><userinput>chmod -v 755 /usr/lib/*.&ncurses-version;</userinput></screen>
  79. <para>Fix a library that should not be executable:</para>
  80. <screen><userinput>chmod -v 644 /usr/lib/libncurses++w.a</userinput></screen>
  81. <para>Move the libraries to the <filename class="directory">/lib</filename> directory,
  82. where they are expected to reside:</para>
  83. <screen><userinput>mv -v /usr/lib/libncursesw.so.5* /lib</userinput></screen>
  84. <para>Because the libraries have been moved, one symlink points to
  85. a non-existent file. Recreate it:</para>
  86. <screen><userinput>ln -sfv ../../lib/libncursesw.so.5 /usr/lib/libncursesw.so</userinput></screen>
  87. <para>Many applications still expect the linker to be able to find
  88. non-wide-character Ncurses libraries. Trick such applications into linking with
  89. wide-character libraries by means of symlinks and linker scripts:</para>
  90. <screen><userinput>for lib in curses ncurses form panel menu ; do \
  91. rm -vf /usr/lib/lib${lib}.so ; \
  92. echo "INPUT(-l${lib}w)" &gt;/usr/lib/lib${lib}.so ; \
  93. ln -sfv lib${lib}w.a /usr/lib/lib${lib}.a ; \
  94. done &amp;&amp;
  95. ln -sfv libncurses++w.a /usr/lib/libncurses++.a</userinput></screen>
  96. <para>Finally, make sure that old applications that look for
  97. <filename class="libraryfile">-lcurses</filename> at build time are still
  98. buildable:</para>
  99. <screen><userinput>echo "INPUT(-lncursesw)" &gt;/usr/lib/libcursesw.so &amp;&amp;
  100. ln -sfv libncurses.so /usr/lib/libcurses.so &amp;&amp;
  101. ln -sfv libncursesw.a /usr/lib/libcursesw.a &amp;&amp;
  102. ln -sfv libncurses.a /usr/lib/libcurses.a</userinput></screen>
  103. <note>
  104. <para>The instructions above don't create non-wide-character Ncurses
  105. libraries since no package installed by compiling from sources would
  106. link against them at runtime. If you must have such libraries because
  107. of some binary-only application, build them with the following
  108. commands:</para>
  109. <screen role="nodump"><userinput>make distclean &amp;&amp;
  110. ./configure --prefix=/usr --with-shared --without-normal \
  111. --without-debug --without-cxx-binding &amp;&amp;
  112. make sources libs &amp;&amp;
  113. cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
  114. </note>
  115. </sect2>
  116. <sect2 id="contents-ncurses" role="content">
  117. <title>Contents of Ncurses</title>
  118. <segmentedlist>
  119. <segtitle>Installed programs</segtitle>
  120. <segtitle>Installed libraries</segtitle>
  121. <seglistitem>
  122. <seg>captoinfo (link to tic), clear, infocmp, infotocap (link to tic),
  123. reset (link to tset), tack, tic, toe, tput, and tset</seg>
  124. <seg>libcursesw.[a,so] (symlink and linker script to libncursesw.[a,so]),
  125. libformw.[a,so], libmenuw.[a,so], libncurses++w.a, libncursesw.[a,so],
  126. libpanelw.[a,so] and their non-wide-character counterparts without "w"
  127. in the library names.</seg>
  128. </seglistitem>
  129. </segmentedlist>
  130. <variablelist>
  131. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  132. <?dbfo list-presentation="list"?>
  133. <?dbhtml list-presentation="table"?>
  134. <varlistentry id="captoinfo">
  135. <term><command>captoinfo</command></term>
  136. <listitem>
  137. <para>Converts a termcap description into a terminfo description</para>
  138. <indexterm zone="ch-system-ncurses captoinfo">
  139. <primary sortas="b-captoinfo">captoinfo</primary>
  140. </indexterm>
  141. </listitem>
  142. </varlistentry>
  143. <varlistentry id="clear">
  144. <term><command>clear</command></term>
  145. <listitem>
  146. <para>Clears the screen, if possible</para>
  147. <indexterm zone="ch-system-ncurses clear">
  148. <primary sortas="b-clear">clear</primary>
  149. </indexterm>
  150. </listitem>
  151. </varlistentry>
  152. <varlistentry id="infocmp">
  153. <term><command>infocmp</command></term>
  154. <listitem>
  155. <para>Compares or prints out terminfo descriptions</para>
  156. <indexterm zone="ch-system-ncurses infocmp">
  157. <primary sortas="b-infocmp">infocmp</primary>
  158. </indexterm>
  159. </listitem>
  160. </varlistentry>
  161. <varlistentry id="infotocap">
  162. <term><command>infotocap</command></term>
  163. <listitem>
  164. <para>Converts a terminfo description into a termcap description</para>
  165. <indexterm zone="ch-system-ncurses infotocap">
  166. <primary sortas="b-infotocap">infotocap</primary>
  167. </indexterm>
  168. </listitem>
  169. </varlistentry>
  170. <varlistentry id="reset">
  171. <term><command>reset</command></term>
  172. <listitem>
  173. <para>Reinitializes a terminal to its default values</para>
  174. <indexterm zone="ch-system-ncurses reset">
  175. <primary sortas="b-reset">reset</primary>
  176. </indexterm>
  177. </listitem>
  178. </varlistentry>
  179. <varlistentry id="tack">
  180. <term><command>tack</command></term>
  181. <listitem>
  182. <para>The terminfo action checker; it is mainly used to test the
  183. accuracy of an entry in the terminfo database</para>
  184. <indexterm zone="ch-system-ncurses tack">
  185. <primary sortas="b-tack">tack</primary>
  186. </indexterm>
  187. </listitem>
  188. </varlistentry>
  189. <varlistentry id="tic">
  190. <term><command>tic</command></term>
  191. <listitem>
  192. <para>The terminfo entry-description compiler that translates a
  193. terminfo file from source format into the binary format needed for the
  194. ncurses library routines. A terminfo file contains information on the
  195. capabilities of a certain terminal</para>
  196. <indexterm zone="ch-system-ncurses tic">
  197. <primary sortas="b-tic">tic</primary>
  198. </indexterm>
  199. </listitem>
  200. </varlistentry>
  201. <varlistentry id="toe">
  202. <term><command>toe</command></term>
  203. <listitem>
  204. <para>Lists all available terminal types, giving the primary name and
  205. description for each</para>
  206. <indexterm zone="ch-system-ncurses toe">
  207. <primary sortas="b-toe">toe</primary>
  208. </indexterm>
  209. </listitem>
  210. </varlistentry>
  211. <varlistentry id="tput">
  212. <term><command>tput</command></term>
  213. <listitem>
  214. <para>Makes the values of terminal-dependent capabilities available to
  215. the shell; it can also be used to reset or initialize a terminal or
  216. report its long name</para>
  217. <indexterm zone="ch-system-ncurses tput">
  218. <primary sortas="b-tput">tput</primary>
  219. </indexterm>
  220. </listitem>
  221. </varlistentry>
  222. <varlistentry id="tset">
  223. <term><command>tset</command></term>
  224. <listitem>
  225. <para>Can be used to initialize terminals</para>
  226. <indexterm zone="ch-system-ncurses tset">
  227. <primary sortas="b-tset">tset</primary>
  228. </indexterm>
  229. </listitem>
  230. </varlistentry>
  231. <varlistentry id="libcurses">
  232. <term><filename class="libraryfile">libcurses</filename></term>
  233. <listitem>
  234. <para>A link to <filename>libncurses</filename></para>
  235. <indexterm zone="ch-system-ncurses libcurses">
  236. <primary sortas="c-libcurses">libcurses</primary>
  237. </indexterm>
  238. </listitem>
  239. </varlistentry>
  240. <varlistentry id="libncurses">
  241. <term><filename class="libraryfile">libncurses</filename></term>
  242. <listitem>
  243. <para>Contains functions to display text in many complex ways on a
  244. terminal screen; a good example of the use of these functions is the
  245. menu displayed during the kernel's <command>make
  246. menuconfig</command></para>
  247. <indexterm zone="ch-system-ncurses libncurses">
  248. <primary sortas="c-libncurses">libncurses</primary>
  249. </indexterm>
  250. </listitem>
  251. </varlistentry>
  252. <varlistentry id="libform">
  253. <term><filename class="libraryfile">libform</filename></term>
  254. <listitem>
  255. <para>Contains functions to implement forms</para>
  256. <indexterm zone="ch-system-ncurses libform">
  257. <primary sortas="c-libform">libform</primary>
  258. </indexterm>
  259. </listitem>
  260. </varlistentry>
  261. <varlistentry id="libmenu">
  262. <term><filename class="libraryfile">libmenu</filename></term>
  263. <listitem>
  264. <para>Contains functions to implement menus</para>
  265. <indexterm zone="ch-system-ncurses libmenu">
  266. <primary sortas="c-libmenu">libmenu</primary>
  267. </indexterm>
  268. </listitem>
  269. </varlistentry>
  270. <varlistentry id="libpanel">
  271. <term><filename class="libraryfile">libpanel</filename></term>
  272. <listitem>
  273. <para>Contains functions to implement panels</para>
  274. <indexterm zone="ch-system-ncurses libpanel">
  275. <primary sortas="c-libpanel">libpanel</primary>
  276. </indexterm>
  277. </listitem>
  278. </varlistentry>
  279. </variablelist>
  280. </sect2>
  281. </sect1>