ncurses.xml 10 KB

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