Changeset 6dfcfecc for chapter06/ncurses.xml
- Timestamp:
- 03/31/2021 10:41:39 AM (3 years ago)
- Branches:
- ml-11.0, multilib
- Children:
- 7610848
- Parents:
- 811b5a39
- git-author:
- Thomas Trepl <thomas@…> (06/29/2020 07:55:01 AM)
- git-committer:
- Xℹ Ruoyao <xry111@…> (03/31/2021 10:41:39 AM)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter06/ncurses.xml
r811b5a39 r6dfcfecc 6 6 ]> 7 7 8 <sect1 id="ch- system-ncurses" role="wrap">8 <sect1 id="ch-tools-ncurses" role="wrap"> 9 9 <?dbhtml filename="ncurses.html"?> 10 10 … … 17 17 <title>Ncurses-&ncurses-version;</title> 18 18 19 <indexterm zone="ch- system-ncurses">19 <indexterm zone="ch-tools-ncurses"> 20 20 <primary sortas="a-Ncurses">Ncurses</primary> 21 <secondary>tools</secondary> 21 22 </indexterm> 22 23 … … 24 25 <title/> 25 26 26 <para>The Ncurses package contains libraries for terminal-independent 27 handling of character screens.</para> 27 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 28 href="../chapter08/ncurses.xml" 29 xpointer="xpointer(/sect1/sect2[1]/para[1])"/> 28 30 29 31 <segmentedlist> … … 32 34 33 35 <seglistitem> 34 <seg>&ncurses- ch6-sbu;</seg>35 <seg>&ncurses- ch6-du;</seg>36 <seg>&ncurses-tmp-sbu;</seg> 37 <seg>&ncurses-tmp-du;</seg> 36 38 </seglistitem> 37 39 </segmentedlist> … … 42 44 <title>Installation of Ncurses</title> 43 45 44 <para>Don't install a static library that is not handled by configure:</para> 45 46 <screen><userinput remap="pre">sed -i '/LIBTOOL_INSTALL/d' c++/Makefile.in</userinput></screen> 46 <para>First, ensure that <command>gawk</command> is found first during configuration:</para> 47 48 <screen><userinput remap="pre">sed -i s/mawk// configure</userinput></screen> 49 50 <para>Then, run the following commands to build the <quote>tic</quote> 51 program on the build host:</para> 52 53 <screen><userinput remap="pre">mkdir build 54 pushd build 55 ../configure 56 make -C include 57 make -C progs tic 58 popd</userinput></screen> 47 59 48 60 <para>Prepare Ncurses for compilation:</para> 49 61 50 <screen arch="default"><userinput remap="configure">./configure --prefix=/usr \ 51 --mandir=/usr/share/man \ 52 --with-shared \ 53 --without-debug \ 54 --without-normal \ 55 --enable-pc-files \ 62 <screen><userinput remap="configure">./configure --prefix=/usr \ 63 --host=$LFS_TGT \ 64 --build=$(./config.guess) \ 65 --mandir=/usr/share/man \ 66 --with-manpage-format=normal \ 67 --with-shared \ 68 --without-debug \ 69 --without-ada \ 70 --without-normal \ 56 71 --enable-widec</userinput></screen> 57 <screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure">./configure --prefix=/usr \58 --mandir=/usr/share/man \59 --with-shared \60 --without-debug \61 --without-normal \62 --enable-pc-files \63 --enable-widec \64 --with-pkg-config-libdir=/usr/lib/pkgconfig</userinput></screen>65 72 66 73 <variablelist> 67 74 <title>The meaning of the new configure options:</title> 75 76 <varlistentry> 77 <term><parameter>--with-manpage-format=normal</parameter></term> 78 <listitem> 79 <para>This prevents Ncurses installing compressed manual 80 pages, which may happen if the host distribution itself 81 has compressed manual pages.</para> 82 </listitem> 83 </varlistentry> 84 85 <varlistentry> 86 <term><parameter>--without-ada</parameter></term> 87 <listitem> 88 <para>This ensures that Ncurses does not build support for the Ada 89 compiler which may be present on the host but will not be available 90 once we enter the <command>chroot</command> environment.</para> 91 </listitem> 92 </varlistentry> 68 93 69 94 <varlistentry> … … 82 107 83 108 <varlistentry> 84 <term><parameter>--enable-pc-files</parameter></term>85 <listitem>86 <para>This switch generates and installs .pc files for pkg-config.87 </para>88 </listitem>89 </varlistentry>90 91 <varlistentry>92 109 <term><parameter>--without-normal</parameter></term> 93 110 <listitem> … … 97 114 </varlistentry> 98 115 99 <varlistentry arch="ml_32,ml_x32,ml_all">100 <term><parameter>--with-pkg-config-libdir=/usr/lib/pkgconfig</parameter></term>101 <listitem>102 <para>This switch forces .pc to be installed in /usr/lib/pkgconfig. If103 not set, .pc files gets installed in /usr/lib32 even for 64bit binaries.104 </para>105 </listitem>106 </varlistentry>107 108 116 </variablelist> 109 117 … … 112 120 <screen><userinput remap="make">make</userinput></screen> 113 121 114 <para>This package has a test suite, but it can only be run after the115 package has been installed. The tests reside in the116 <filename class="directory">test/</filename> directory. See the117 <filename>README</filename> file in that directory for further details.118 </para>119 120 122 <para>Install the package:</para> 121 122 <screen><userinput remap="install">make install</userinput></screen> 123 <!-- TODO: check and document --> 124 <screen><userinput remap="install">make DESTDIR=$LFS TIC_PATH=$(pwd)/build/progs/tic install 125 ln -s libncursesw.so $LFS/usr/lib/libncurses.so</userinput></screen> 123 126 124 127 <para>Move the shared libraries to the … … 126 129 expected to reside:</para> 127 130 128 <screen><userinput remap="install">mv -v /usr/lib/libncursesw.so.6*/lib</userinput></screen>131 <screen><userinput remap="install">mv -v $LFS/usr/lib/libncursesw.so.6* $LFS/lib</userinput></screen> 129 132 130 133 <para>Because the libraries have been moved, one symlink points to 131 134 a non-existent file. Recreate it:</para> 132 135 133 <screen><userinput remap="install">ln -sfv ../../lib/$(readlink /usr/lib/libncursesw.so) /usr/lib/libncursesw.so</userinput></screen> 134 135 <para>Many applications still expect the linker to be able to find 136 non-wide-character Ncurses libraries. Trick such applications into linking with 137 wide-character libraries by means of symlinks and linker scripts:</para> 138 139 <screen><userinput remap="install">for lib in ncurses form panel menu ; do 140 rm -vf /usr/lib/lib${lib}.so 141 echo "INPUT(-l${lib}w)" > /usr/lib/lib${lib}.so 142 ln -sfv ${lib}w.pc /usr/lib/pkgconfig/${lib}.pc 143 done</userinput></screen> 144 145 <para>Finally, make sure that old applications that look for 146 <filename class="libraryfile">-lcurses</filename> at build time are still 147 buildable:</para> 148 149 <screen><userinput remap="install">rm -vf /usr/lib/libcursesw.so 150 echo "INPUT(-lncursesw)" > /usr/lib/libcursesw.so 151 ln -sfv libncurses.so /usr/lib/libcurses.so</userinput></screen> 152 153 <para>If desired, install the Ncurses documentation:</para> 154 155 <screen><userinput remap="install">mkdir -v /usr/share/doc/ncurses-&ncurses-version; 156 cp -v -R doc/* /usr/share/doc/ncurses-&ncurses-version;</userinput></screen> 157 158 <note> 159 <para>The instructions above don't create non-wide-character Ncurses 160 libraries since no package installed by compiling from sources would link 161 against them at runtime. However, the only known binary-only 162 applications that link against non-wide-character Ncurses libraries 163 require version 5. If you must have such libraries because of some binary-only 164 application or to be compliant with LSB, build the package again with the 165 following commands:</para> 166 167 <screen><userinput remap="install">make distclean 168 ./configure --prefix=/usr \ 169 --with-shared \ 170 --without-normal \ 171 --without-debug \ 172 --without-cxx-binding \ 173 --with-abi-version=5 174 make sources libs 175 cp -av lib/lib*.so.5* /usr/lib</userinput></screen> 176 177 </note> 136 <screen><userinput remap="install">ln -sfv ../../lib/$(readlink $LFS/usr/lib/libncursesw.so) $LFS/usr/lib/libncursesw.so</userinput></screen> 178 137 179 138 </sect2> 180 139 181 <!-- ~~~~~~~~~~~~~~~~~~~~ ABI 32 ~~~~~~~~~~~~~~~~~~~~ --> 182 183 <sect2 arch="ml_32,ml_all" role="installation"> 184 <title>Installation of Ncurses - 32-bit</title> 140 <!-- - - - - - - - - - --> 141 <!-- Multilib - 32bit --> 142 <!-- - - - - - - - - - --> 143 <sect2 arch="ml_32,ml_all"> 144 <title>Building Ncurses - 32bit</title> 185 145 186 146 <para>Clean previous build:</para> … … 188 148 <screen><userinput remap="pre">make distclean</userinput></screen> 189 149 190 <para>Prepare Ncurses for compilation:</para> 191 192 <screen><userinput remap="configure">CC="gcc -m32" CXX="g++ -m32" \ 193 ./configure --prefix=/usr \ 194 --libdir=/usr/lib32 \ 195 --mandir=/usr/share/man \ 196 --with-shared \ 197 --without-debug \ 198 --without-normal \ 199 --enable-pc-files \ 200 --enable-widec \ 201 --host=i686-pc-linux-gnu \ 202 --with-pkg-config-libdir=/usr/lib32/pkgconfig</userinput></screen> 150 <para>Prepare Ncurses for compilation:</para> 151 152 <screen><userinput remap="configure">CC="$LFS_TGT-gcc -m32" \ 153 CXX="$LFS_TGT-g++ -m32" \ 154 ./configure --prefix=/usr \ 155 --host=$LFS_TGT32 \ 156 --libdir=&usr-lib-m32; \ 157 --mandir=/usr/share/man \ 158 --with-shared \ 159 --without-debug \ 160 --without-normal \ 161 --enable-pc-files \ 162 --enable-widec \ 163 --with-pkg-config-libdir=&usr-lib-m32;/pkgconfig</userinput></screen> 203 164 204 165 <para>Compile the package:</para> 205 166 206 <screen><userinput remap="make">make -j1</userinput></screen>167 <screen><userinput remap="make">make</userinput></screen> 207 168 208 169 <para>Install the package:</para> 209 170 210 <screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install 211 for lib in ncurses form panel menu ; do 212 rm -vf DESTDIR/usr/lib32/lib${lib}.so 213 echo "INPUT(-l${lib}w)" > DESTDIR/usr/lib32/lib${lib}.so 214 ln -svf ${lib}w.pc DESTDIR/usr/lib32/pkgconfig/$lib.pc 215 done 216 rm -vf DESTDIR/usr/lib32/libcursesw.so 217 echo "INPUT(-lncursesw)" > DESTDIR/usr/lib32/libcursesw.so 218 ln -sfv libncurses.so DESTDIR/usr/lib32/libcurses.so 219 cp -Rv DESTDIR/usr/lib32/* /usr/lib32 171 <screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR TIC_PATH=$(pwd)/build/progs/tic install 172 ln -s libncursesw.so DESTDIR&usr-lib-m32;/libcursesw.so 173 cp -Rv DESTDIR&usr-lib-m32;/* $LFS&usr-lib-m32; 220 174 rm -rf DESTDIR</userinput></screen> 221 175 222 <para>If desired, make the version 5 libraries in 32bit as well:</para> 223 224 <screen><userinput remap="install">make distclean 225 CC="gcc -m32" CXX="g++ -m32" \ 226 ./configure --prefix=/usr \ 227 --with-shared \ 228 --without-normal \ 229 --without-debug \ 230 --without-cxx-binding \ 231 --with-abi-version=5 \ 232 --host=i686-pc-linux-gnu 233 make -j1 sources libs 234 cp -av lib/lib*.so.5* /usr/lib32</userinput></screen> 176 </sect2><!-- m32 --> 177 178 <!-- - - - - - - - - - --> 179 <!-- Multilib - x32bit --> 180 <!-- - - - - - - - - - --> 181 <sect2 arch="ml_x32,ml_all"> 182 <title>Building Ncurses - x32bit</title> 183 184 <para>Clean previous build:</para> 185 186 <screen><userinput remap="pre">make distclean</userinput></screen> 187 188 <para>Prepare Ncurses for compilation:</para> 189 190 <screen><userinput remap="configure">CC="$LFS_TGT-gcc -mx32" \ 191 CXX="$LFS_TGT-g++ -mx32" \ 192 ./configure --prefix=/usr \ 193 --host=$LFS_TGTX32 \ 194 --libdir=&usr-lib-mx32; \ 195 --mandir=/usr/share/man \ 196 --with-shared \ 197 --without-debug \ 198 --without-normal \ 199 --enable-pc-files \ 200 --enable-widec \ 201 --with-pkg-config-libdir=&usr-lib-mx32;/pkgconfig</userinput></screen> 202 203 <para>Compile the package:</para> 204 205 <screen><userinput remap="make">make</userinput></screen> 206 207 <para>Install the package:</para> 208 209 <screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR TIC_PATH=$(pwd)/build/progs/tic install 210 ln -s libncursesw.so DESTDIR&usr-lib-mx32;/libcursesw.so 211 cp -Rv DESTDIR&usr-lib-mx32;/* $LFS&usr-lib-mx32; 212 rm -rf DESTDIR</userinput></screen> 213 214 </sect2><!-- mx32 --> 215 216 <sect2 role="content"> 217 <title/> 218 219 <para>Details on this package are located in 220 <xref linkend="contents-ncurses" role="."/></para> 235 221 236 222 </sect2> 237 223 238 <!-- ~~~~~~~~~~~~~~~~~~~~ ABI x32 ~~~~~~~~~~~~~~~~~~~~ -->239 240 <sect2 arch="ml_x32,ml_all" role="installation">241 <title>Installation of Ncurses - x32-bit</title>242 243 <para>Clean previous build:</para>244 245 <screen><userinput remap="pre">make distclean</userinput></screen>246 247 <para>Prepare Ncurses for compilation:</para>248 249 <screen><userinput remap="configure">CC="gcc -mx32" CXX="g++ -mx32" \250 ./configure --prefix=/usr \251 --libdir=/usr/libx32 \252 --mandir=/usr/share/man \253 --with-shared \254 --without-debug \255 --without-normal \256 --enable-pc-files \257 --enable-widec \258 --host=x86_64-pc-linux-gnux32 \259 --with-pkg-config-libdir=/usr/libx32/pkgconfig</userinput></screen>260 261 <para>Compile the package:</para>262 263 <screen><userinput remap="make">make -j1</userinput></screen>264 265 <para>Install the package:</para>266 267 <screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install268 for lib in ncurses form panel menu ; do269 rm -vf DESTDIR/usr/libx32/lib${lib}.so270 echo "INPUT(-l${lib}w)" > DESTDIR/usr/libx32/lib${lib}.so271 ln -svf ${lib}w.pc DESTDIR/usr/libx32/pkgconfig/$lib.pc272 done273 rm -vf DESTDIR/usr/libx32/libcursesw.so274 echo "INPUT(-lncursesw)" > DESTDIR/usr/libx32/libcursesw.so275 ln -sfv libncurses.so DESTDIR/usr/libx32/libcurses.so276 cp -Rv DESTDIR/usr/libx32/* /usr/libx32277 rm -rf DESTDIR</userinput></screen>278 279 <!-- Any package out there which still needs version 5?280 Leave it out for x32bit for now.281 282 <para>If desired, make the version 5 libraries in x32bit as well:</para>283 284 <screen><userinput remap="install">make distclean285 CC="gcc -mx32" CXX="g++ -mx32" \286 ./configure - -prefix=/usr \287 - -with-shared \288 - -without-normal \289 - -without-debug \290 - -without-cxx-binding \291 - -with-abi-version=5292 make -j1 sources libs293 cp -av lib/lib*.so.5* /usr/libx32</userinput></screen>294 -->295 </sect2>296 297 <sect2 id="contents-ncurses" role="content">298 <title>Contents of Ncurses</title>299 300 <segmentedlist>301 <segtitle>Installed programs</segtitle>302 <segtitle>Installed libraries</segtitle>303 <segtitle>Installed directories</segtitle>304 305 <seglistitem>306 <seg>307 captoinfo (link to tic),308 clear,309 infocmp,310 infotocap (link to tic),311 ncursesw6-config,312 reset (link to tset),313 tabs,314 tic,315 toe,316 tput, and317 tset318 </seg>319 <seg>320 libcursesw.so (symlink and linker script to libncursesw.so),321 libformw.so,322 libmenuw.so,323 libncursesw.so,324 libncurses++w.a,325 libpanelw.so, and their non-wide-character counterparts without "w"326 in the library names.</seg>327 <seg>328 /usr/share/tabset,329 /usr/share/terminfo, and330 /usr/share/doc/ncurses-&ncurses-version;331 </seg>332 </seglistitem>333 </segmentedlist>334 335 <variablelist>336 <bridgehead renderas="sect3">Short Descriptions</bridgehead>337 <?dbfo list-presentation="list"?>338 <?dbhtml list-presentation="table"?>339 340 <varlistentry id="captoinfo">341 <term><command>captoinfo</command></term>342 <listitem>343 <para>Converts a termcap description into a terminfo description</para>344 <indexterm zone="ch-system-ncurses captoinfo">345 <primary sortas="b-captoinfo">captoinfo</primary>346 </indexterm>347 </listitem>348 </varlistentry>349 350 <varlistentry id="clear">351 <term><command>clear</command></term>352 <listitem>353 <para>Clears the screen, if possible</para>354 <indexterm zone="ch-system-ncurses clear">355 <primary sortas="b-clear">clear</primary>356 </indexterm>357 </listitem>358 </varlistentry>359 360 <varlistentry id="infocmp">361 <term><command>infocmp</command></term>362 <listitem>363 <para>Compares or prints out terminfo descriptions</para>364 <indexterm zone="ch-system-ncurses infocmp">365 <primary sortas="b-infocmp">infocmp</primary>366 </indexterm>367 </listitem>368 </varlistentry>369 370 <varlistentry id="infotocap">371 <term><command>infotocap</command></term>372 <listitem>373 <para>Converts a terminfo description into a termcap description</para>374 <indexterm zone="ch-system-ncurses infotocap">375 <primary sortas="b-infotocap">infotocap</primary>376 </indexterm>377 </listitem>378 </varlistentry>379 380 <varlistentry id="ncursesw6-config">381 <term><command>ncursesw6-config</command></term>382 <listitem>383 <para>Provides configuration information for ncurses</para>384 <indexterm zone="ch-system-ncurses ncursesw6-config">385 <primary sortas="b-ncursesw6-config">ncursesw6-config</primary>386 </indexterm>387 </listitem>388 </varlistentry>389 390 <varlistentry id="reset">391 <term><command>reset</command></term>392 <listitem>393 <para>Reinitializes a terminal to its default values</para>394 <indexterm zone="ch-system-ncurses reset">395 <primary sortas="b-reset">reset</primary>396 </indexterm>397 </listitem>398 </varlistentry>399 400 <varlistentry id="tabs">401 <term><command>tabs</command></term>402 <listitem>403 <para>Clears and sets tab stops on a terminal</para>404 <indexterm zone="ch-system-ncurses tabs">405 <primary sortas="b-tabs">tabs</primary>406 </indexterm>407 </listitem>408 </varlistentry>409 410 <varlistentry id="tic">411 <term><command>tic</command></term>412 <listitem>413 <para>The terminfo entry-description compiler that translates a414 terminfo file from source format into the binary format needed for the415 ncurses library routines [A terminfo file contains information on the416 capabilities of a certain terminal.]</para>417 <indexterm zone="ch-system-ncurses tic">418 <primary sortas="b-tic">tic</primary>419 </indexterm>420 </listitem>421 </varlistentry>422 423 <varlistentry id="toe">424 <term><command>toe</command></term>425 <listitem>426 <para>Lists all available terminal types, giving the primary name and427 description for each</para>428 <indexterm zone="ch-system-ncurses toe">429 <primary sortas="b-toe">toe</primary>430 </indexterm>431 </listitem>432 </varlistentry>433 434 <varlistentry id="tput">435 <term><command>tput</command></term>436 <listitem>437 <para>Makes the values of terminal-dependent capabilities available to438 the shell; it can also be used to reset or initialize a terminal or439 report its long name</para>440 <indexterm zone="ch-system-ncurses tput">441 <primary sortas="b-tput">tput</primary>442 </indexterm>443 </listitem>444 </varlistentry>445 446 <varlistentry id="tset">447 <term><command>tset</command></term>448 <listitem>449 <para>Can be used to initialize terminals</para>450 <indexterm zone="ch-system-ncurses tset">451 <primary sortas="b-tset">tset</primary>452 </indexterm>453 </listitem>454 </varlistentry>455 456 <varlistentry id="libcursesw">457 <term><filename class="libraryfile">libcursesw</filename></term>458 <listitem>459 <para>A link to <filename>libncursesw</filename></para>460 <indexterm zone="ch-system-ncurses libcursesw">461 <primary sortas="c-libcursesw">libcursesw</primary>462 </indexterm>463 </listitem>464 </varlistentry>465 466 <varlistentry id="libncursesw">467 <term><filename class="libraryfile">libncursesw</filename></term>468 <listitem>469 <para>Contains functions to display text in many complex ways on a470 terminal screen; a good example of the use of these functions is the471 menu displayed during the kernel's <command>make472 menuconfig</command></para>473 <indexterm zone="ch-system-ncurses libncursesw">474 <primary sortas="c-libncursesw">libncursesw</primary>475 </indexterm>476 </listitem>477 </varlistentry>478 479 <varlistentry id="libformw">480 <term><filename class="libraryfile">libformw</filename></term>481 <listitem>482 <para>Contains functions to implement forms</para>483 <indexterm zone="ch-system-ncurses libformw">484 <primary sortas="c-libformw">libformw</primary>485 </indexterm>486 </listitem>487 </varlistentry>488 489 <varlistentry id="libmenuw">490 <term><filename class="libraryfile">libmenuw</filename></term>491 <listitem>492 <para>Contains functions to implement menus</para>493 <indexterm zone="ch-system-ncurses libmenuw">494 <primary sortas="c-libmenuw">libmenuw</primary>495 </indexterm>496 </listitem>497 </varlistentry>498 499 <varlistentry id="libpanelw">500 <term><filename class="libraryfile">libpanelw</filename></term>501 <listitem>502 <para>Contains functions to implement panels</para>503 <indexterm zone="ch-system-ncurses libpanelw">504 <primary sortas="c-libpanelw">libpanelw</primary>505 </indexterm>506 </listitem>507 </varlistentry>508 509 </variablelist>510 511 </sect2>512 513 224 </sect1>
Note:
See TracChangeset
for help on using the changeset viewer.