[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 |
|
---|
[e4b4449d] | 46 | <para>First, run the following commands to build the <quote>tic</quote>
|
---|
[fcc02767] | 47 | program on the build host:</para>
|
---|
| 48 |
|
---|
| 49 | <screen><userinput remap="pre">mkdir build
|
---|
[bc8cca5] | 50 | pushd build
|
---|
[e4b4449d] | 51 | ../configure AWK=gawk
|
---|
[bc8cca5] | 52 | make -C include
|
---|
| 53 | make -C progs tic
|
---|
| 54 | popd</userinput></screen>
|
---|
[fa21b3d] | 55 |
|
---|
[2fa922f] | 56 | <para>Prepare Ncurses for compilation:</para>
|
---|
[73aedd1d] | 57 |
|
---|
[94ec149] | 58 | <screen><userinput remap="configure">./configure --prefix=/usr \
|
---|
| 59 | --host=$LFS_TGT \
|
---|
| 60 | --build=$(./config.guess) \
|
---|
| 61 | --mandir=/usr/share/man \
|
---|
| 62 | --with-manpage-format=normal \
|
---|
| 63 | --with-shared \
|
---|
[f8b27ab] | 64 | --without-normal \
|
---|
| 65 | --with-cxx-shared \
|
---|
[94ec149] | 66 | --without-debug \
|
---|
| 67 | --without-ada \
|
---|
[e4b4449d] | 68 | --disable-stripping \
|
---|
| 69 | AWK=gawk</userinput></screen>
|
---|
[fa21b3d] | 70 |
|
---|
[2fa922f] | 71 | <variablelist>
|
---|
[d51dfb9] | 72 | <title>The meaning of the new configure options:</title>
|
---|
[2fa922f] | 73 |
|
---|
[94ec149] | 74 | <varlistentry>
|
---|
| 75 | <term><parameter>--with-manpage-format=normal</parameter></term>
|
---|
| 76 | <listitem>
|
---|
[5e8bab7] | 77 | <para>This prevents Ncurses from installing compressed manual
|
---|
[94ec149] | 78 | pages, which may happen if the host distribution itself
|
---|
| 79 | has compressed manual pages.</para>
|
---|
| 80 | </listitem>
|
---|
| 81 | </varlistentry>
|
---|
| 82 |
|
---|
[f8b27ab] | 83 | <varlistentry>
|
---|
| 84 | <term><parameter>--with-shared</parameter></term>
|
---|
| 85 | <listitem>
|
---|
| 86 | <para>This makes Ncurses build and install shared C libraries.</para>
|
---|
| 87 | </listitem>
|
---|
| 88 | </varlistentry>
|
---|
| 89 |
|
---|
| 90 | <varlistentry>
|
---|
| 91 | <term><parameter>--without-normal</parameter></term>
|
---|
| 92 | <listitem>
|
---|
[5e8bab7] | 93 | <para>This prevents Ncurses from building and installing static C
|
---|
[f8b27ab] | 94 | libraries.</para>
|
---|
| 95 | </listitem>
|
---|
| 96 | </varlistentry>
|
---|
| 97 |
|
---|
| 98 | <varlistentry>
|
---|
| 99 | <term><parameter>--without-debug</parameter></term>
|
---|
| 100 | <listitem>
|
---|
[5e8bab7] | 101 | <para>This prevents Ncurses from building and installing debug
|
---|
[f8b27ab] | 102 | libraries.</para>
|
---|
| 103 | </listitem>
|
---|
| 104 | </varlistentry>
|
---|
| 105 |
|
---|
| 106 | <varlistentry>
|
---|
| 107 | <term><parameter>--with-cxx-shared</parameter></term>
|
---|
| 108 | <listitem>
|
---|
| 109 | <para>This makes Ncurses build and install shared C++ bindings. It
|
---|
| 110 | also prevents it building and installing static C++ bindings.</para>
|
---|
| 111 | </listitem>
|
---|
| 112 | </varlistentry>
|
---|
| 113 |
|
---|
[fcc02767] | 114 | <varlistentry>
|
---|
| 115 | <term><parameter>--without-ada</parameter></term>
|
---|
| 116 | <listitem>
|
---|
| 117 | <para>This ensures that Ncurses does not build support for the Ada
|
---|
[6dff9ef] | 118 | compiler, which may be present on the host but will not be available
|
---|
[fcc02767] | 119 | once we enter the <command>chroot</command> environment.</para>
|
---|
| 120 | </listitem>
|
---|
| 121 | </varlistentry>
|
---|
| 122 |
|
---|
[e0f124e] | 123 | <varlistentry>
|
---|
| 124 | <term><parameter>--disable-stripping</parameter></term>
|
---|
| 125 | <listitem>
|
---|
[6dff9ef] | 126 | <para>This switch prevents the building system from
|
---|
| 127 | using the <command>strip</command> program from the host.
|
---|
| 128 | Using host tools on cross-compiled programs can cause failure.</para>
|
---|
[e0f124e] | 129 | </listitem>
|
---|
| 130 | </varlistentry>
|
---|
[e4b4449d] | 131 |
|
---|
[2fa922f] | 132 | <varlistentry>
|
---|
[e4b4449d] | 133 | <term><parameter>AWK=gawk</parameter></term>
|
---|
[2fa922f] | 134 | <listitem>
|
---|
[e4b4449d] | 135 | <para>This switch prevents the building system from using the
|
---|
| 136 | <command>mawk</command> program from the host.
|
---|
| 137 | Some<!-- FIXME vauge --> versions of <command>mawk</command> can
|
---|
[c5fbd9d] | 138 | cause this package to fail to build. <!-- It seems happened in 2015,
|
---|
[e4b4449d] | 139 | is there any updated into? --></para>
|
---|
[2fa922f] | 140 | </listitem>
|
---|
| 141 | </varlistentry>
|
---|
| 142 | </variablelist>
|
---|
| 143 |
|
---|
| 144 | <para>Compile the package:</para>
|
---|
[73aedd1d] | 145 |
|
---|
[0445a3d] | 146 | <screen><userinput remap="make">make</userinput></screen>
|
---|
[73aedd1d] | 147 |
|
---|
[2fa922f] | 148 | <para>Install the package:</para>
|
---|
[fe039b5] | 149 |
|
---|
[fcc02767] | 150 | <screen><userinput remap="install">make DESTDIR=$LFS TIC_PATH=$(pwd)/build/progs/tic install
|
---|
[943f225] | 151 | ln -sv libncursesw.so $LFS/usr/lib/libncurses.so
|
---|
[d282f88] | 152 | sed -e 's/^#if.*XOPEN.*$/#if 1/' \
|
---|
| 153 | -i $LFS/usr/include/curses.h</userinput></screen>
|
---|
[f8b27ab] | 154 | <!--
|
---|
[2bb813a] | 155 | <para>Remove an unneeded static library not handled by
|
---|
| 156 | <command>configure</command>:</para>
|
---|
| 157 |
|
---|
[f81a8a4] | 158 | <screen><userinput remap="install">rm -v $LFS/usr/lib/libncurses++w.a</userinput></screen>
|
---|
[f8b27ab] | 159 | -->
|
---|
[fe039b5] | 160 | <variablelist>
|
---|
| 161 | <title>The meaning of the install options:</title>
|
---|
| 162 |
|
---|
| 163 | <varlistentry>
|
---|
| 164 | <term><parameter>TIC_PATH=$(pwd)/build/progs/tic</parameter></term>
|
---|
| 165 | <listitem>
|
---|
[6dff9ef] | 166 | <para>We need to pass the path of the newly built
|
---|
| 167 | <command>tic</command> program that runs on the building machine, so
|
---|
[fe039b5] | 168 | the terminal database can be created without errors.</para>
|
---|
| 169 | </listitem>
|
---|
| 170 | </varlistentry>
|
---|
| 171 |
|
---|
| 172 | <varlistentry>
|
---|
[943f225] | 173 | <term><command>ln -sv libncursesw.so $LFS/usr/lib/libncurses.so</command></term>
|
---|
[fe039b5] | 174 | <listitem>
|
---|
| 175 | <para>The <filename>libncurses.so</filename> library is needed by
|
---|
[943f225] | 176 | a few packages we will build soon. We create this symlink to use
|
---|
| 177 | <filename>libncursesw.so</filename> as a replacement.</para>
|
---|
[fe039b5] | 178 | </listitem>
|
---|
| 179 | </varlistentry>
|
---|
| 180 |
|
---|
[d282f88] | 181 | <varlistentry>
|
---|
| 182 | <term><command>sed -e 's/^#if.*XOPEN.*$/#if 1/' ...</command></term>
|
---|
| 183 | <listitem>
|
---|
| 184 | <para>The header file <filename>curses.h</filename> contains
|
---|
| 185 | the definition of various Ncurses data structures. With different
|
---|
| 186 | preprocessor macro definitions two different sets of the data
|
---|
| 187 | structure definition may be used: the 8-bit definition is
|
---|
| 188 | compatible with <filename>libncurses.so</filename> and the
|
---|
| 189 | wide-character definition is compatible with
|
---|
| 190 | <filename>libncursesw.so</filename>. Since we are using
|
---|
| 191 | <filename>libncursesw.so</filename> as a replacement of
|
---|
| 192 | <filename>libncurses.so</filename>, edit the header file so it
|
---|
| 193 | will always use the wide-character data structure definition
|
---|
| 194 | compatible with <filename>libncursesw.so</filename>.</para>
|
---|
| 195 | </listitem>
|
---|
| 196 | </varlistentry>
|
---|
| 197 |
|
---|
[fe039b5] | 198 | </variablelist>
|
---|
[73aedd1d] | 199 |
|
---|
[2fa922f] | 200 | </sect2>
|
---|
| 201 |
|
---|
[fcc02767] | 202 | <sect2 role="content">
|
---|
| 203 | <title/>
|
---|
[2fa922f] | 204 |
|
---|
[fcc02767] | 205 | <para>Details on this package are located in
|
---|
| 206 | <xref linkend="contents-ncurses" role="."/></para>
|
---|
[2fa922f] | 207 |
|
---|
| 208 | </sect2>
|
---|
[673b0d8] | 209 |
|
---|
| 210 | </sect1>
|
---|