[7152faa] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
[b06ca36] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[673b0d8] | 4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
[2fa922f] | 7 |
|
---|
[fcc02767] | 8 | <sect1 id="ch-tools-ncurses" role="wrap">
|
---|
[2fa922f] | 9 | <?dbhtml filename="ncurses.html"?>
|
---|
| 10 |
|
---|
[e747759] | 11 | <sect1info condition="script">
|
---|
| 12 | <productname>ncurses</productname>
|
---|
| 13 | <productnumber>&ncurses-version;</productnumber>
|
---|
| 14 | <address>&ncurses-url;</address>
|
---|
| 15 | </sect1info>
|
---|
| 16 |
|
---|
[2fa922f] | 17 | <title>Ncurses-&ncurses-version;</title>
|
---|
| 18 |
|
---|
[fcc02767] | 19 | <indexterm zone="ch-tools-ncurses">
|
---|
[2fa922f] | 20 | <primary sortas="a-Ncurses">Ncurses</primary>
|
---|
[fcc02767] | 21 | <secondary>tools</secondary>
|
---|
[2fa922f] | 22 | </indexterm>
|
---|
| 23 |
|
---|
| 24 | <sect2 role="package">
|
---|
| 25 | <title/>
|
---|
[6370fa6] | 26 |
|
---|
[fcc02767] | 27 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 28 | href="../chapter08/ncurses.xml"
|
---|
| 29 | xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
|
---|
[673b0d8] | 30 |
|
---|
[2fa922f] | 31 | <segmentedlist>
|
---|
| 32 | <segtitle>&buildtime;</segtitle>
|
---|
| 33 | <segtitle>&diskspace;</segtitle>
|
---|
[5888299] | 34 |
|
---|
[2fa922f] | 35 | <seglistitem>
|
---|
[fb386e0] | 36 | <seg>&ncurses-tmp-sbu;</seg>
|
---|
| 37 | <seg>&ncurses-tmp-du;</seg>
|
---|
[2fa922f] | 38 | </seglistitem>
|
---|
| 39 | </segmentedlist>
|
---|
[673b0d8] | 40 |
|
---|
[2fa922f] | 41 | </sect2>
|
---|
| 42 |
|
---|
| 43 | <sect2 role="installation">
|
---|
| 44 | <title>Installation of Ncurses</title>
|
---|
[004616a] | 45 |
|
---|
[fcc02767] | 46 | <para>First, ensure that <command>gawk</command> is found first during configuration:</para>
|
---|
[2fa922f] | 47 |
|
---|
[fcc02767] | 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
|
---|
[bc8cca5] | 54 | pushd build
|
---|
| 55 | ../configure
|
---|
| 56 | make -C include
|
---|
| 57 | make -C progs tic
|
---|
| 58 | popd</userinput></screen>
|
---|
[fa21b3d] | 59 |
|
---|
[2fa922f] | 60 | <para>Prepare Ncurses for compilation:</para>
|
---|
[73aedd1d] | 61 |
|
---|
[94ec149] | 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 \
|
---|
[f8b27ab] | 68 | --without-normal \
|
---|
| 69 | --with-cxx-shared \
|
---|
[94ec149] | 70 | --without-debug \
|
---|
| 71 | --without-ada \
|
---|
[3abde59] | 72 | --disable-stripping</userinput></screen>
|
---|
[fa21b3d] | 73 |
|
---|
[2fa922f] | 74 | <variablelist>
|
---|
[d51dfb9] | 75 | <title>The meaning of the new configure options:</title>
|
---|
[2fa922f] | 76 |
|
---|
[94ec149] | 77 | <varlistentry>
|
---|
| 78 | <term><parameter>--with-manpage-format=normal</parameter></term>
|
---|
| 79 | <listitem>
|
---|
[5e8bab7] | 80 | <para>This prevents Ncurses from installing compressed manual
|
---|
[94ec149] | 81 | pages, which may happen if the host distribution itself
|
---|
| 82 | has compressed manual pages.</para>
|
---|
| 83 | </listitem>
|
---|
| 84 | </varlistentry>
|
---|
| 85 |
|
---|
[f8b27ab] | 86 | <varlistentry>
|
---|
| 87 | <term><parameter>--with-shared</parameter></term>
|
---|
| 88 | <listitem>
|
---|
| 89 | <para>This makes Ncurses build and install shared C libraries.</para>
|
---|
| 90 | </listitem>
|
---|
| 91 | </varlistentry>
|
---|
| 92 |
|
---|
| 93 | <varlistentry>
|
---|
| 94 | <term><parameter>--without-normal</parameter></term>
|
---|
| 95 | <listitem>
|
---|
[5e8bab7] | 96 | <para>This prevents Ncurses from building and installing static C
|
---|
[f8b27ab] | 97 | libraries.</para>
|
---|
| 98 | </listitem>
|
---|
| 99 | </varlistentry>
|
---|
| 100 |
|
---|
| 101 | <varlistentry>
|
---|
| 102 | <term><parameter>--without-debug</parameter></term>
|
---|
| 103 | <listitem>
|
---|
[5e8bab7] | 104 | <para>This prevents Ncurses from building and installing debug
|
---|
[f8b27ab] | 105 | libraries.</para>
|
---|
| 106 | </listitem>
|
---|
| 107 | </varlistentry>
|
---|
| 108 |
|
---|
| 109 | <varlistentry>
|
---|
| 110 | <term><parameter>--with-cxx-shared</parameter></term>
|
---|
| 111 | <listitem>
|
---|
| 112 | <para>This makes Ncurses build and install shared C++ bindings. It
|
---|
| 113 | also prevents it building and installing static C++ bindings.</para>
|
---|
| 114 | </listitem>
|
---|
| 115 | </varlistentry>
|
---|
| 116 |
|
---|
[fcc02767] | 117 | <varlistentry>
|
---|
| 118 | <term><parameter>--without-ada</parameter></term>
|
---|
| 119 | <listitem>
|
---|
| 120 | <para>This ensures that Ncurses does not build support for the Ada
|
---|
[6dff9ef] | 121 | compiler, which may be present on the host but will not be available
|
---|
[fcc02767] | 122 | once we enter the <command>chroot</command> environment.</para>
|
---|
| 123 | </listitem>
|
---|
| 124 | </varlistentry>
|
---|
| 125 |
|
---|
[e0f124e] | 126 | <varlistentry>
|
---|
| 127 | <term><parameter>--disable-stripping</parameter></term>
|
---|
| 128 | <listitem>
|
---|
[6dff9ef] | 129 | <para>This switch prevents the building system from
|
---|
| 130 | using the <command>strip</command> program from the host.
|
---|
| 131 | Using host tools on cross-compiled programs can cause failure.</para>
|
---|
[e0f124e] | 132 | </listitem>
|
---|
| 133 | </varlistentry>
|
---|
[3abde59] | 134 | <!-- this is the default >= 6.5
|
---|
[2fa922f] | 135 | <varlistentry>
|
---|
[3abde59] | 136 | <term><parameter>- -enable-widec</parameter></term>
|
---|
[2fa922f] | 137 | <listitem>
|
---|
| 138 | <para>This switch causes wide-character libraries (e.g., <filename
|
---|
[5a661c39] | 139 | class="libraryfile">libncursesw.so.&ncurses-version;</filename>)
|
---|
[2fa922f] | 140 | to be built instead of normal ones (e.g., <filename
|
---|
[5a661c39] | 141 | class="libraryfile">libncurses.so.&ncurses-version;</filename>).
|
---|
[2fa922f] | 142 | These wide-character libraries are usable in both multibyte and
|
---|
| 143 | traditional 8-bit locales, while normal libraries work properly
|
---|
| 144 | only in 8-bit locales. Wide-character and normal libraries are
|
---|
| 145 | source-compatible, but not binary-compatible.</para>
|
---|
| 146 | </listitem>
|
---|
| 147 | </varlistentry>
|
---|
[3abde59] | 148 | -->
|
---|
[2fa922f] | 149 | </variablelist>
|
---|
| 150 |
|
---|
| 151 | <para>Compile the package:</para>
|
---|
[73aedd1d] | 152 |
|
---|
[0445a3d] | 153 | <screen><userinput remap="make">make</userinput></screen>
|
---|
[73aedd1d] | 154 |
|
---|
[2fa922f] | 155 | <para>Install the package:</para>
|
---|
[fe039b5] | 156 |
|
---|
[fcc02767] | 157 | <screen><userinput remap="install">make DESTDIR=$LFS TIC_PATH=$(pwd)/build/progs/tic install
|
---|
[943f225] | 158 | ln -sv libncursesw.so $LFS/usr/lib/libncurses.so
|
---|
[d282f88] | 159 | sed -e 's/^#if.*XOPEN.*$/#if 1/' \
|
---|
| 160 | -i $LFS/usr/include/curses.h</userinput></screen>
|
---|
[f8b27ab] | 161 | <!--
|
---|
[2bb813a] | 162 | <para>Remove an unneeded static library not handled by
|
---|
| 163 | <command>configure</command>:</para>
|
---|
| 164 |
|
---|
[f81a8a4] | 165 | <screen><userinput remap="install">rm -v $LFS/usr/lib/libncurses++w.a</userinput></screen>
|
---|
[f8b27ab] | 166 | -->
|
---|
[fe039b5] | 167 | <variablelist>
|
---|
| 168 | <title>The meaning of the install options:</title>
|
---|
| 169 |
|
---|
| 170 | <varlistentry>
|
---|
| 171 | <term><parameter>TIC_PATH=$(pwd)/build/progs/tic</parameter></term>
|
---|
| 172 | <listitem>
|
---|
[6dff9ef] | 173 | <para>We need to pass the path of the newly built
|
---|
| 174 | <command>tic</command> program that runs on the building machine, so
|
---|
[fe039b5] | 175 | the terminal database can be created without errors.</para>
|
---|
| 176 | </listitem>
|
---|
| 177 | </varlistentry>
|
---|
| 178 |
|
---|
| 179 | <varlistentry>
|
---|
[943f225] | 180 | <term><command>ln -sv libncursesw.so $LFS/usr/lib/libncurses.so</command></term>
|
---|
[fe039b5] | 181 | <listitem>
|
---|
| 182 | <para>The <filename>libncurses.so</filename> library is needed by
|
---|
[943f225] | 183 | a few packages we will build soon. We create this symlink to use
|
---|
| 184 | <filename>libncursesw.so</filename> as a replacement.</para>
|
---|
[fe039b5] | 185 | </listitem>
|
---|
| 186 | </varlistentry>
|
---|
| 187 |
|
---|
[d282f88] | 188 | <varlistentry>
|
---|
| 189 | <term><command>sed -e 's/^#if.*XOPEN.*$/#if 1/' ...</command></term>
|
---|
| 190 | <listitem>
|
---|
| 191 | <para>The header file <filename>curses.h</filename> contains
|
---|
| 192 | the definition of various Ncurses data structures. With different
|
---|
| 193 | preprocessor macro definitions two different sets of the data
|
---|
| 194 | structure definition may be used: the 8-bit definition is
|
---|
| 195 | compatible with <filename>libncurses.so</filename> and the
|
---|
| 196 | wide-character definition is compatible with
|
---|
| 197 | <filename>libncursesw.so</filename>. Since we are using
|
---|
| 198 | <filename>libncursesw.so</filename> as a replacement of
|
---|
| 199 | <filename>libncurses.so</filename>, edit the header file so it
|
---|
| 200 | will always use the wide-character data structure definition
|
---|
| 201 | compatible with <filename>libncursesw.so</filename>.</para>
|
---|
| 202 | </listitem>
|
---|
| 203 | </varlistentry>
|
---|
| 204 |
|
---|
[fe039b5] | 205 | </variablelist>
|
---|
[73aedd1d] | 206 |
|
---|
[2fa922f] | 207 | </sect2>
|
---|
| 208 |
|
---|
[fcc02767] | 209 | <sect2 role="content">
|
---|
| 210 | <title/>
|
---|
[2fa922f] | 211 |
|
---|
[fcc02767] | 212 | <para>Details on this package are located in
|
---|
| 213 | <xref linkend="contents-ncurses" role="."/></para>
|
---|
[2fa922f] | 214 |
|
---|
| 215 | </sect2>
|
---|
[673b0d8] | 216 |
|
---|
| 217 | </sect1>
|
---|