ncurses.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/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. <sect1info condition="script">
  10. <productname>ncurses</productname>
  11. <productnumber>&ncurses-version;</productnumber>
  12. <address>&ncurses-url;</address>
  13. </sect1info>
  14. <title>Ncurses-&ncurses-version;</title>
  15. <indexterm zone="ch-system-ncurses">
  16. <primary sortas="a-Ncurses">Ncurses</primary>
  17. </indexterm>
  18. <sect2 role="package">
  19. <title/>
  20. <para>The Ncurses package contains libraries for terminal-independent
  21. handling of character screens.</para>
  22. <segmentedlist>
  23. <segtitle>&buildtime;</segtitle>
  24. <segtitle>&diskspace;</segtitle>
  25. <seglistitem>
  26. <seg>&ncurses-ch6-sbu;</seg>
  27. <seg>&ncurses-ch6-du;</seg>
  28. </seglistitem>
  29. </segmentedlist>
  30. </sect2>
  31. <sect2 role="installation">
  32. <title>Installation of Ncurses</title>
  33. <para>Don't install a static library that is not handled by configure:</para>
  34. <screen><userinput remap="pre">sed -i '/LIBTOOL_INSTALL/d' c++/Makefile.in</userinput></screen>
  35. <para>Prepare Ncurses for compilation:</para>
  36. <screen arch="default"><userinput remap="configure">./configure --prefix=/usr \
  37. --mandir=/usr/share/man \
  38. --with-shared \
  39. --without-debug \
  40. --without-normal \
  41. --enable-pc-files \
  42. --enable-widec</userinput></screen>
  43. <screen arch="multilib"><userinput remap="configure">./configure --prefix=/usr \
  44. --mandir=/usr/share/man \
  45. --with-shared \
  46. --without-debug \
  47. --without-normal \
  48. --enable-pc-files \
  49. --enable-widec \
  50. --with-pkg-config-libdir=/usr/lib/pkgconfig</userinput></screen>
  51. <variablelist>
  52. <title>The meaning of the new configure options:</title>
  53. <varlistentry>
  54. <term><parameter>--enable-widec</parameter></term>
  55. <listitem>
  56. <para>This switch causes wide-character libraries (e.g., <filename
  57. class="libraryfile">libncursesw.so.&ncurses-version;</filename>)
  58. to be built instead of normal ones (e.g., <filename
  59. class="libraryfile">libncurses.so.&ncurses-version;</filename>).
  60. These wide-character libraries are usable in both multibyte and
  61. traditional 8-bit locales, while normal libraries work properly
  62. only in 8-bit locales. Wide-character and normal libraries are
  63. source-compatible, but not binary-compatible.</para>
  64. </listitem>
  65. </varlistentry>
  66. <varlistentry>
  67. <term><parameter>--enable-pc-files</parameter></term>
  68. <listitem>
  69. <para>This switch generates and installs .pc files for pkg-config.
  70. </para>
  71. </listitem>
  72. </varlistentry>
  73. <varlistentry>
  74. <term><parameter>--without-normal</parameter></term>
  75. <listitem>
  76. <para>This switch disables building and installing most static libraries.
  77. </para>
  78. </listitem>
  79. </varlistentry>
  80. <varlistentry arch="multilib">
  81. <term><parameter>--with-pkg-config-libdir=/usr/lib/pkgconfig</parameter></term>
  82. <listitem>
  83. <para>This switch forces .pc to be installed in /usr/lib/pkgconfig. If
  84. not set, .pc files gets installed in /usr/lib32 even for 64bit binaries.
  85. </para>
  86. </listitem>
  87. </varlistentry>
  88. </variablelist>
  89. <para>Compile the package:</para>
  90. <screen><userinput remap="make">make</userinput></screen>
  91. <para>This package has a test suite, but it can only be run after the
  92. package has been installed. The tests reside in the
  93. <filename class="directory">test/</filename> directory. See the
  94. <filename>README</filename> file in that directory for further details.
  95. </para>
  96. <para>Install the package:</para>
  97. <screen><userinput remap="install">make install</userinput></screen>
  98. <para>Move the shared libraries to the
  99. <filename class="directory">/lib</filename> directory, where they are
  100. expected to reside:</para>
  101. <screen><userinput remap="install">mv -v /usr/lib/libncursesw.so.6* /lib</userinput></screen>
  102. <para>Because the libraries have been moved, one symlink points to
  103. a non-existent file. Recreate it:</para>
  104. <screen><userinput remap="install">ln -sfv ../../lib/$(readlink /usr/lib/libncursesw.so) /usr/lib/libncursesw.so</userinput></screen>
  105. <para>Many applications still expect the linker to be able to find
  106. non-wide-character Ncurses libraries. Trick such applications into linking with
  107. wide-character libraries by means of symlinks and linker scripts:</para>
  108. <screen><userinput remap="install">for lib in ncurses form panel menu ; do
  109. rm -vf /usr/lib/lib${lib}.so
  110. echo "INPUT(-l${lib}w)" &gt; /usr/lib/lib${lib}.so
  111. ln -sfv ${lib}w.pc /usr/lib/pkgconfig/${lib}.pc
  112. done</userinput></screen>
  113. <para>Finally, make sure that old applications that look for
  114. <filename class="libraryfile">-lcurses</filename> at build time are still
  115. buildable:</para>
  116. <screen><userinput remap="install">rm -vf /usr/lib/libcursesw.so
  117. echo "INPUT(-lncursesw)" &gt; /usr/lib/libcursesw.so
  118. ln -sfv libncurses.so /usr/lib/libcurses.so</userinput></screen>
  119. <para>If desired, install the Ncurses documentation:</para>
  120. <screen><userinput remap="install">mkdir -v /usr/share/doc/ncurses-&ncurses-version;
  121. cp -v -R doc/* /usr/share/doc/ncurses-&ncurses-version;</userinput></screen>
  122. <note>
  123. <para>The instructions above don't create non-wide-character Ncurses
  124. libraries since no package installed by compiling from sources would link
  125. against them at runtime. However, the only known binary-only
  126. applications that link against non-wide-character Ncurses libraries
  127. require version 5. If you must have such libraries because of some binary-only
  128. application or to be compliant with LSB, build the package again with the
  129. following commands:</para>
  130. <screen><userinput remap="install">make distclean
  131. ./configure --prefix=/usr \
  132. --with-shared \
  133. --without-normal \
  134. --without-debug \
  135. --without-cxx-binding \
  136. --with-abi-version=5
  137. make sources libs
  138. cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
  139. </note>
  140. </sect2>
  141. <sect2 arch="multilib" role="installation">
  142. <title>Installation of Ncurses - 32-bit</title>
  143. <para>Clean previous build:</para>
  144. <screen><userinput remap="pre">make distclean</userinput></screen>
  145. <para>Prepare Ncurses for compilation:</para>
  146. <screen><userinput remap="configure">CC="gcc -m32" CXX="g++ -m32" \
  147. ./configure --prefix=/usr \
  148. --libdir=/usr/lib32 \
  149. --mandir=/usr/share/man \
  150. --with-shared \
  151. --without-debug \
  152. --without-normal \
  153. --enable-pc-files \
  154. --enable-widec \
  155. --host=i686-pc-linux-gnu \
  156. --with-pkg-config-libdir=/usr/lib32/pkgconfig</userinput></screen>
  157. <para>Compile the package:</para>
  158. <screen><userinput remap="make">make -j1</userinput></screen>
  159. <para>Install the package:</para>
  160. <screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
  161. for lib in ncurses form panel menu ; do
  162. rm -vf DESTDIR/usr/lib32/lib${lib}.so
  163. echo "INPUT(-l${lib}w)" > DESTDIR/usr/lib32/lib${lib}.so
  164. ln -svf ${lib}w.pc DESTDIR/usr/lib32/pkgconfig/$lib.pc
  165. done
  166. rm -vf DESTDIR/usr/lib32/libcursesw.so
  167. echo "INPUT(-lncursesw)" > DESTDIR/usr/lib32/libcursesw.so
  168. ln -sfv libncurses.so DESTDIR/usr/lib32/libcurses.so
  169. cp -Rv DESTDIR/usr/lib32/* /usr/lib32
  170. rm -rf DESTDIR</userinput></screen>
  171. <para>If desired, make the version 5 libraries in 32bit as well:</para>
  172. <screen><userinput remap="install">make distclean
  173. CC="gcc -m32" CXX="g++ -m32" \
  174. ./configure --prefix=/usr \
  175. --with-shared \
  176. --without-normal \
  177. --without-debug \
  178. --without-cxx-binding \
  179. --with-abi-version=5 \
  180. --host=i686-pc-linux-gnu
  181. make -j1 sources libs
  182. cp -av lib/lib*.so.5* /usr/lib32</userinput></screen>
  183. </sect2>
  184. <sect2 arch="multilib" role="installation">
  185. <title>Installation of Ncurses - x32-bit</title>
  186. <para>Clean previous build:</para>
  187. <screen><userinput remap="pre">make distclean</userinput></screen>
  188. <para>Prepare Ncurses for compilation:</para>
  189. <screen><userinput remap="configure">CC="gcc -mx32" CXX="g++ -mx32" \
  190. ./configure --prefix=/usr \
  191. --libdir=/usr/libx32 \
  192. --mandir=/usr/share/man \
  193. --with-shared \
  194. --without-debug \
  195. --without-normal \
  196. --enable-pc-files \
  197. --enable-widec \
  198. --host=x86_64-pc-linux-gnux32 \
  199. --with-pkg-config-libdir=/usr/libx32/pkgconfig</userinput></screen>
  200. <para>Compile the package:</para>
  201. <screen><userinput remap="make">make -j1</userinput></screen>
  202. <para>Install the package:</para>
  203. <screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
  204. for lib in ncurses form panel menu ; do
  205. rm -vf DESTDIR/usr/libx32/lib${lib}.so
  206. echo "INPUT(-l${lib}w)" > DESTDIR/usr/libx32/lib${lib}.so
  207. ln -svf ${lib}w.pc DESTDIR/usr/libx32/pkgconfig/$lib.pc
  208. done
  209. rm -vf DESTDIR/usr/libx32/libcursesw.so
  210. echo "INPUT(-lncursesw)" > DESTDIR/usr/libx32/libcursesw.so
  211. ln -sfv libncurses.so DESTDIR/usr/libx32/libcurses.so
  212. cp -Rv DESTDIR/usr/libx32/* /usr/libx32
  213. rm -rf DESTDIR</userinput></screen>
  214. <!-- Any package out there which still needs version 5?
  215. Leave it out for x32bit for now.
  216. <para>If desired, make the version 5 libraries in x32bit as well:</para>
  217. <screen><userinput remap="install">make distclean
  218. CC="gcc -mx32" CXX="g++ -mx32" \
  219. ./configure - -prefix=/usr \
  220. - -with-shared \
  221. - -without-normal \
  222. - -without-debug \
  223. - -without-cxx-binding \
  224. - -with-abi-version=5
  225. make -j1 sources libs
  226. cp -av lib/lib*.so.5* /usr/libx32</userinput></screen>
  227. -->
  228. </sect2>
  229. <sect2 id="contents-ncurses" role="content">
  230. <title>Contents of Ncurses</title>
  231. <segmentedlist>
  232. <segtitle>Installed programs</segtitle>
  233. <segtitle>Installed libraries</segtitle>
  234. <segtitle>Installed directories</segtitle>
  235. <seglistitem>
  236. <seg>
  237. captoinfo (link to tic),
  238. clear,
  239. infocmp,
  240. infotocap (link to tic),
  241. ncursesw6-config,
  242. reset (link to tset),
  243. tabs,
  244. tic,
  245. toe,
  246. tput, and
  247. tset
  248. </seg>
  249. <seg>
  250. libcursesw.so (symlink and linker script to libncursesw.so),
  251. libformw.so,
  252. libmenuw.so,
  253. libncursesw.so,
  254. libncurses++w.a,
  255. libpanelw.so, and their non-wide-character counterparts without "w"
  256. in the library names.</seg>
  257. <seg>
  258. /usr/share/tabset,
  259. /usr/share/terminfo, and
  260. /usr/share/doc/ncurses-&ncurses-version;
  261. </seg>
  262. </seglistitem>
  263. </segmentedlist>
  264. <variablelist>
  265. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  266. <?dbfo list-presentation="list"?>
  267. <?dbhtml list-presentation="table"?>
  268. <varlistentry id="captoinfo">
  269. <term><command>captoinfo</command></term>
  270. <listitem>
  271. <para>Converts a termcap description into a terminfo description</para>
  272. <indexterm zone="ch-system-ncurses captoinfo">
  273. <primary sortas="b-captoinfo">captoinfo</primary>
  274. </indexterm>
  275. </listitem>
  276. </varlistentry>
  277. <varlistentry id="clear">
  278. <term><command>clear</command></term>
  279. <listitem>
  280. <para>Clears the screen, if possible</para>
  281. <indexterm zone="ch-system-ncurses clear">
  282. <primary sortas="b-clear">clear</primary>
  283. </indexterm>
  284. </listitem>
  285. </varlistentry>
  286. <varlistentry id="infocmp">
  287. <term><command>infocmp</command></term>
  288. <listitem>
  289. <para>Compares or prints out terminfo descriptions</para>
  290. <indexterm zone="ch-system-ncurses infocmp">
  291. <primary sortas="b-infocmp">infocmp</primary>
  292. </indexterm>
  293. </listitem>
  294. </varlistentry>
  295. <varlistentry id="infotocap">
  296. <term><command>infotocap</command></term>
  297. <listitem>
  298. <para>Converts a terminfo description into a termcap description</para>
  299. <indexterm zone="ch-system-ncurses infotocap">
  300. <primary sortas="b-infotocap">infotocap</primary>
  301. </indexterm>
  302. </listitem>
  303. </varlistentry>
  304. <varlistentry id="ncursesw6-config">
  305. <term><command>ncursesw6-config</command></term>
  306. <listitem>
  307. <para>Provides configuration information for ncurses</para>
  308. <indexterm zone="ch-system-ncurses ncursesw6-config">
  309. <primary sortas="b-ncursesw6-config">ncursesw6-config</primary>
  310. </indexterm>
  311. </listitem>
  312. </varlistentry>
  313. <varlistentry id="reset">
  314. <term><command>reset</command></term>
  315. <listitem>
  316. <para>Reinitializes a terminal to its default values</para>
  317. <indexterm zone="ch-system-ncurses reset">
  318. <primary sortas="b-reset">reset</primary>
  319. </indexterm>
  320. </listitem>
  321. </varlistentry>
  322. <varlistentry id="tabs">
  323. <term><command>tabs</command></term>
  324. <listitem>
  325. <para>Clears and sets tab stops on a terminal</para>
  326. <indexterm zone="ch-system-ncurses tabs">
  327. <primary sortas="b-tabs">tabs</primary>
  328. </indexterm>
  329. </listitem>
  330. </varlistentry>
  331. <varlistentry id="tic">
  332. <term><command>tic</command></term>
  333. <listitem>
  334. <para>The terminfo entry-description compiler that translates a
  335. terminfo file from source format into the binary format needed for the
  336. ncurses library routines [A terminfo file contains information on the
  337. capabilities of a certain terminal.]</para>
  338. <indexterm zone="ch-system-ncurses tic">
  339. <primary sortas="b-tic">tic</primary>
  340. </indexterm>
  341. </listitem>
  342. </varlistentry>
  343. <varlistentry id="toe">
  344. <term><command>toe</command></term>
  345. <listitem>
  346. <para>Lists all available terminal types, giving the primary name and
  347. description for each</para>
  348. <indexterm zone="ch-system-ncurses toe">
  349. <primary sortas="b-toe">toe</primary>
  350. </indexterm>
  351. </listitem>
  352. </varlistentry>
  353. <varlistentry id="tput">
  354. <term><command>tput</command></term>
  355. <listitem>
  356. <para>Makes the values of terminal-dependent capabilities available to
  357. the shell; it can also be used to reset or initialize a terminal or
  358. report its long name</para>
  359. <indexterm zone="ch-system-ncurses tput">
  360. <primary sortas="b-tput">tput</primary>
  361. </indexterm>
  362. </listitem>
  363. </varlistentry>
  364. <varlistentry id="tset">
  365. <term><command>tset</command></term>
  366. <listitem>
  367. <para>Can be used to initialize terminals</para>
  368. <indexterm zone="ch-system-ncurses tset">
  369. <primary sortas="b-tset">tset</primary>
  370. </indexterm>
  371. </listitem>
  372. </varlistentry>
  373. <varlistentry id="libcursesw">
  374. <term><filename class="libraryfile">libcursesw</filename></term>
  375. <listitem>
  376. <para>A link to <filename>libncursesw</filename></para>
  377. <indexterm zone="ch-system-ncurses libcursesw">
  378. <primary sortas="c-libcursesw">libcursesw</primary>
  379. </indexterm>
  380. </listitem>
  381. </varlistentry>
  382. <varlistentry id="libncursesw">
  383. <term><filename class="libraryfile">libncursesw</filename></term>
  384. <listitem>
  385. <para>Contains functions to display text in many complex ways on a
  386. terminal screen; a good example of the use of these functions is the
  387. menu displayed during the kernel's <command>make
  388. menuconfig</command></para>
  389. <indexterm zone="ch-system-ncurses libncursesw">
  390. <primary sortas="c-libncursesw">libncursesw</primary>
  391. </indexterm>
  392. </listitem>
  393. </varlistentry>
  394. <varlistentry id="libformw">
  395. <term><filename class="libraryfile">libformw</filename></term>
  396. <listitem>
  397. <para>Contains functions to implement forms</para>
  398. <indexterm zone="ch-system-ncurses libformw">
  399. <primary sortas="c-libformw">libformw</primary>
  400. </indexterm>
  401. </listitem>
  402. </varlistentry>
  403. <varlistentry id="libmenuw">
  404. <term><filename class="libraryfile">libmenuw</filename></term>
  405. <listitem>
  406. <para>Contains functions to implement menus</para>
  407. <indexterm zone="ch-system-ncurses libmenuw">
  408. <primary sortas="c-libmenuw">libmenuw</primary>
  409. </indexterm>
  410. </listitem>
  411. </varlistentry>
  412. <varlistentry id="libpanelw">
  413. <term><filename class="libraryfile">libpanelw</filename></term>
  414. <listitem>
  415. <para>Contains functions to implement panels</para>
  416. <indexterm zone="ch-system-ncurses libpanelw">
  417. <primary sortas="c-libpanelw">libpanelw</primary>
  418. </indexterm>
  419. </listitem>
  420. </varlistentry>
  421. </variablelist>
  422. </sect2>
  423. </sect1>