source: chapter06/ncurses.xml@ e4b4449d

trunk xry111/mips64el
Last change on this file since e4b4449d was e4b4449d, checked in by Xi Ruoyao <xry111@…>, 2 weeks ago

ncurses: Simplify evading from mawk

Since it's overridable with the command line, just override it instead
of using a sed.

  • Property mode set to 100644
File size: 7.1 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
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
8<sect1 id="ch-tools-ncurses" role="wrap">
9 <?dbhtml filename="ncurses.html"?>
10
11 <sect1info condition="script">
12 <productname>ncurses</productname>
13 <productnumber>&ncurses-version;</productnumber>
14 <address>&ncurses-url;</address>
15 </sect1info>
16
17 <title>Ncurses-&ncurses-version;</title>
18
19 <indexterm zone="ch-tools-ncurses">
20 <primary sortas="a-Ncurses">Ncurses</primary>
21 <secondary>tools</secondary>
22 </indexterm>
23
24 <sect2 role="package">
25 <title/>
26
27 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
28 href="../chapter08/ncurses.xml"
29 xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
30
31 <segmentedlist>
32 <segtitle>&buildtime;</segtitle>
33 <segtitle>&diskspace;</segtitle>
34
35 <seglistitem>
36 <seg>&ncurses-tmp-sbu;</seg>
37 <seg>&ncurses-tmp-du;</seg>
38 </seglistitem>
39 </segmentedlist>
40
41 </sect2>
42
43 <sect2 role="installation">
44 <title>Installation of Ncurses</title>
45
46 <para>First, run the following commands to build the <quote>tic</quote>
47 program on the build host:</para>
48
49<screen><userinput remap="pre">mkdir build
50pushd build
51 ../configure AWK=gawk
52 make -C include
53 make -C progs tic
54popd</userinput></screen>
55
56 <para>Prepare Ncurses for compilation:</para>
57
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 \
64 --without-normal \
65 --with-cxx-shared \
66 --without-debug \
67 --without-ada \
68 --disable-stripping \
69 AWK=gawk</userinput></screen>
70
71 <variablelist>
72 <title>The meaning of the new configure options:</title>
73
74 <varlistentry>
75 <term><parameter>--with-manpage-format=normal</parameter></term>
76 <listitem>
77 <para>This prevents Ncurses from installing compressed manual
78 pages, which may happen if the host distribution itself
79 has compressed manual pages.</para>
80 </listitem>
81 </varlistentry>
82
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>
93 <para>This prevents Ncurses from building and installing static C
94 libraries.</para>
95 </listitem>
96 </varlistentry>
97
98 <varlistentry>
99 <term><parameter>--without-debug</parameter></term>
100 <listitem>
101 <para>This prevents Ncurses from building and installing debug
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
114 <varlistentry>
115 <term><parameter>--without-ada</parameter></term>
116 <listitem>
117 <para>This ensures that Ncurses does not build support for the Ada
118 compiler, which may be present on the host but will not be available
119 once we enter the <command>chroot</command> environment.</para>
120 </listitem>
121 </varlistentry>
122
123 <varlistentry>
124 <term><parameter>--disable-stripping</parameter></term>
125 <listitem>
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>
129 </listitem>
130 </varlistentry>
131
132 <varlistentry>
133 <term><parameter>AWK=gawk</parameter></term>
134 <listitem>
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
138 cause this package fail to build. <!-- It seems happened in 2015,
139 is there any updated into? --></para>
140 </listitem>
141 </varlistentry>
142 </variablelist>
143
144 <para>Compile the package:</para>
145
146<screen><userinput remap="make">make</userinput></screen>
147
148 <para>Install the package:</para>
149
150<screen><userinput remap="install">make DESTDIR=$LFS TIC_PATH=$(pwd)/build/progs/tic install
151ln -sv libncursesw.so $LFS/usr/lib/libncurses.so
152sed -e 's/^#if.*XOPEN.*$/#if 1/' \
153 -i $LFS/usr/include/curses.h</userinput></screen>
154<!--
155 <para>Remove an unneeded static library not handled by
156 <command>configure</command>:</para>
157
158<screen><userinput remap="install">rm -v $LFS/usr/lib/libncurses++w.a</userinput></screen>
159-->
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>
166 <para>We need to pass the path of the newly built
167 <command>tic</command> program that runs on the building machine, so
168 the terminal database can be created without errors.</para>
169 </listitem>
170 </varlistentry>
171
172 <varlistentry>
173 <term><command>ln -sv libncursesw.so $LFS/usr/lib/libncurses.so</command></term>
174 <listitem>
175 <para>The <filename>libncurses.so</filename> library is needed by
176 a few packages we will build soon. We create this symlink to use
177 <filename>libncursesw.so</filename> as a replacement.</para>
178 </listitem>
179 </varlistentry>
180
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
198 </variablelist>
199
200 </sect2>
201
202 <sect2 role="content">
203 <title/>
204
205 <para>Details on this package are located in
206 <xref linkend="contents-ncurses" role="."/></para>
207
208 </sect2>
209
210</sect1>
Note: See TracBrowser for help on using the repository browser.