OSDN Git Service

Update to lfsbook 7.2.ja
[linuxjf/JF.git] / docs / LFS-BOOK / chapter06 / ncurses.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4   <head>
5     <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
6     <title>
7       6.21. Ncurses-5.9
8     </title>
9     <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" />
10     <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
11     <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
12     "text/css" media="print" />
13   </head>
14   <body class="lfs" id="lfs-7.2">
15     <div class="navheader">
16       <h4>
17         Linux From Scratch - Version 7.2
18       </h4>
19       <h3>
20         第6章 基本的なソフトウェアのインストール
21       </h3>
22       <ul>
23         <li class="prev">
24           <a accesskey="p" href="pkg-config.html" title=
25           "Pkg-config-0.27">前のページ</a>
26           <p>
27             Pkg-config-0.27
28           </p>
29         </li>
30         <li class="next">
31           <a accesskey="n" href="util-linux.html" title=
32           "Util-linux-2.21.2">次のページ</a>
33           <p>
34             Util-linux-2.21.2
35           </p>
36         </li>
37         <li class="up">
38           <a accesskey="u" href="chapter06.html" title=
39           "第6章 基本的なソフトウェアのインストール">上に戻る</a>
40         </li>
41         <li class="home">
42           <a accesskey="h" href="../index.html" title=
43           "Linux From Scratch - Version 7.2">ホーム</a>
44         </li>
45       </ul>
46     </div>
47     <div class="wrap" lang="ja" xml:lang="ja">
48       <h1 class="sect1">
49         <a id="ch-system-ncurses" name="ch-system-ncurses"></a>6.21.
50         Ncurses-5.9
51       </h1>
52       <div class="package" lang="ja" xml:lang="ja">
53         <p>
54           Ncurses パッケージは、端末に依存しない、文字ベースのスクリーン制御を行うライブラリを提供します。
55         </p>
56         <div class="segmentedlist">
57           <div class="seglistitem">
58             <div class="seg">
59               <strong class="segtitle">概算ビルド時間:</strong> <span class=
60               "segbody">0.6 SBU</span>
61             </div>
62             <div class="seg">
63               <strong class="segtitle">必要ディスク容量:</strong> <span class=
64               "segbody">40 MB</span>
65             </div>
66           </div>
67         </div>
68       </div>
69       <div class="installation" lang="ja" xml:lang="ja">
70         <h2 class="sect2">
71           6.21.1. Ncurses のインストール
72         </h2>
73         <p>
74           Ncurses をコンパイルするための準備をします。
75         </p>
76         <pre class="userinput">
77 <kbd class=
78 "command">./configure --prefix=/usr --mandir=/usr/share/man --with-shared \
79             --without-debug --enable-widec</kbd>
80 </pre>
81         <div class="variablelist">
82           <p class="title">
83             <b>configure オプションの意味:</b>
84           </p>
85           <dl>
86             <dt>
87               <span class="term"><em class=
88               "parameter"><code>--enable-widec</code></em></span>
89             </dt>
90             <dd>
91               <p>
92                 このオプションは通常のライブラリ (<code class=
93                 "filename">libncurses.so.5.9</code>) ではなくワイド文字対応のライブラリ
94                 (<code class="filename">libncursesw.so.5.9</code>)
95                 をビルドすることを指示します。 ワイド文字対応のライブラリは、マルチバイトロケールと従来の
96                 8ビットロケールの双方に対して利用可能です。 通常のライブラリでは 8ビットロケールに対してしか動作しません。
97                 ワイド文字対応と通常のものとでは、ソース互換があるもののバイナリ互換がありません。
98               </p>
99             </dd>
100           </dl>
101         </div>
102         <p>
103           パッケージをコンパイルします。
104         </p>
105         <pre class="userinput">
106 <kbd class="command">make</kbd>
107 </pre>
108         <p>
109           このパッケージにテストスイートはありますが、パッケージをインストールした後でないと実行できません。
110           テストスイートのためのファイル群はサブディレクトリ <code class="filename">test/</code>
111           以下に残っています。 詳しいことはそのディレクトリ内にある <code class="filename">README</code>
112           ファイルを参照してください。
113         </p>
114         <p>
115           パッケージをインストールします。
116         </p>
117         <pre class="userinput">
118 <kbd class="command">make install</kbd>
119 </pre>
120         <p>
121           共有ライブラリを <code class="filename">/lib</code> ディレクトリに移動します。
122           これらはここにあるべきものです。
123         </p>
124         <pre class="userinput">
125 <kbd class="command">mv -v /usr/lib/libncursesw.so.5* /lib</kbd>
126 </pre>
127         <p>
128           ライブラリを移動させたので、シンボリックリンク先が存在しないことになります。 そこでリンクを再生成します。
129         </p>
130         <pre class="userinput">
131 <kbd class=
132 "command">ln -sfv ../../lib/libncursesw.so.5 /usr/lib/libncursesw.so</kbd>
133 </pre>
134         <p>
135           アプリケーションによっては、ワイド文字対応ではないライブラリをリンカーが探し出すよう求めるものが多くあります。
136           そのようなアプリケーションに対しては、以下のようなシンボリックリンクやリンカースクリプトを作り出して、ワイド文字対応のライブラリにリンクさせるよう仕向けます。
137         </p>
138         <pre class="userinput">
139 <kbd class="command">for lib in ncurses form panel menu ; do \
140     rm -vf /usr/lib/lib${lib}.so ; \
141     echo "INPUT(-l${lib}w)" &gt;/usr/lib/lib${lib}.so ; \
142     ln -sfv lib${lib}w.a /usr/lib/lib${lib}.a ; \
143 done
144 ln -sfv libncurses++w.a /usr/lib/libncurses++.a</kbd>
145 </pre>
146         <p>
147           最後に古いアプリケーションにおいて、ビルド時に <code class="filename">-lcurses</code>
148           を指定するものがあるため、これもビルド可能なものにします。
149         </p>
150         <pre class="userinput">
151 <kbd class="command">rm -vf /usr/lib/libcursesw.so
152 echo "INPUT(-lncursesw)" &gt;/usr/lib/libcursesw.so
153 ln -sfv libncurses.so /usr/lib/libcurses.so
154 ln -sfv libncursesw.a /usr/lib/libcursesw.a
155 ln -sfv libncurses.a /usr/lib/libcurses.a</kbd>
156 </pre>
157         <p>
158           必要なら Ncurses のドキュメントをインストールします。
159         </p>
160         <pre class="userinput">
161 <kbd class="command">mkdir -v       /usr/share/doc/ncurses-5.9
162 cp -v -R doc/* /usr/share/doc/ncurses-5.9</kbd>
163 </pre>
164         <div class="admon note">
165           <img alt="[注記]" src="../images/note.png" />
166           <h3>
167             注記
168           </h3>
169           <p>
170             ここまでの作業手順では、ワイド文字対応ではない Ncurses ライブラリは生成しませんでした。
171             ソースからコンパイルして構築するパッケージなら、実行時にそのようなライブラリにリンクするものはないからです。
172             バイナリコードしかないアプリケーションを取り扱う場合、あるいは LSB
173             対応を要する場合で、それがワイド文字対応ではないライブラリを必要とするなら、以下のコマンドによりそのようなライブラリを生成してください。
174           </p>
175           <pre class="userinput">
176 <kbd class="command">make distclean
177 ./configure --prefix=/usr --with-shared --without-normal \
178   --without-debug --without-cxx-binding
179 make sources libs
180 cp -av lib/lib*.so.5* /usr/lib</kbd>
181 </pre>
182         </div>
183       </div>
184       <div class="content" lang="ja" xml:lang="ja">
185         <h2 class="sect2">
186           <a id="contents-ncurses" name="contents-ncurses"></a>6.21.2.
187           Ncurses の構成
188         </h2>
189         <div class="segmentedlist">
190           <div class="seglistitem">
191             <div class="seg">
192               <strong class="segtitle">インストールプログラム:</strong> <span class=
193               "segbody">captoinfo (tic へのリンク), clear, infocmp, infotocap (tic
194               へのリンク), ncursesw5-config, reset (tset へのリンク), tabs, tic, toe,
195               tput, tset</span>
196             </div>
197             <div class="seg">
198               <strong class="segtitle">インストールライブラリ:</strong> <span class=
199               "segbody">libcursesw.{a,so} (libncursesw.{a,so}
200               へのシンボリックリンクおよびリンカースクリプト), libformw.{a,so}, libmenuw.{a,so},
201               libncurses++w.a, libncursesw.{a,so}, libpanelw.{a,so},
202               これらに加えてワイド文字対応ではない通常のライブラリで、その名称から "w" を取り除いたもの。</span>
203             </div>
204             <div class="seg">
205               <strong class="segtitle">インストールディレクトリ:</strong> <span class=
206               "segbody">/usr/share/tabset, /usr/share/terminfo</span>
207             </div>
208           </div>
209         </div>
210         <div class="variablelist">
211           <h3>
212             概略説明
213           </h3>
214           <table border="0">
215             <col align="left" valign="top" />
216             <tbody>
217               <tr>
218                 <td>
219                   <p>
220                     <a id="captoinfo" name="captoinfo"></a><span class=
221                     "term"><span class=
222                     "command"><strong>captoinfo</strong></span></span>
223                   </p>
224                 </td>
225                 <td>
226                   <p>
227                     termcap の記述を terminfo の記述に変換します。
228                   </p>
229                 </td>
230               </tr>
231               <tr>
232                 <td>
233                   <p>
234                     <a id="clear" name="clear"></a><span class=
235                     "term"><span class=
236                     "command"><strong>clear</strong></span></span>
237                   </p>
238                 </td>
239                 <td>
240                   <p>
241                     画面消去が可能ならこれを行います。
242                   </p>
243                 </td>
244               </tr>
245               <tr>
246                 <td>
247                   <p>
248                     <a id="infocmp" name="infocmp"></a><span class=
249                     "term"><span class=
250                     "command"><strong>infocmp</strong></span></span>
251                   </p>
252                 </td>
253                 <td>
254                   <p>
255                     terminfo の記述どうしを比較したり出力したりします。
256                   </p>
257                 </td>
258               </tr>
259               <tr>
260                 <td>
261                   <p>
262                     <a id="infotocap" name="infotocap"></a><span class=
263                     "term"><span class=
264                     "command"><strong>infotocap</strong></span></span>
265                   </p>
266                 </td>
267                 <td>
268                   <p>
269                     terminfo の記述を termcap の記述に変換します。
270                   </p>
271                 </td>
272               </tr>
273               <tr>
274                 <td>
275                   <p>
276                     <a id="ncursesw5-config" name=
277                     "ncursesw5-config"></a><span class="term"><span class=
278                     "command"><strong>ncursesw5-config</strong></span></span>
279                   </p>
280                 </td>
281                 <td>
282                   <p>
283                     ncurses の設定情報を提供します。
284                   </p>
285                 </td>
286               </tr>
287               <tr>
288                 <td>
289                   <p>
290                     <a id="reset" name="reset"></a><span class=
291                     "term"><span class=
292                     "command"><strong>reset</strong></span></span>
293                   </p>
294                 </td>
295                 <td>
296                   <p>
297                     端末をデフォルト設定に初期化します。
298                   </p>
299                 </td>
300               </tr>
301               <tr>
302                 <td>
303                   <p>
304                     <a id="tabs" name="tabs"></a><span class=
305                     "term"><span class=
306                     "command"><strong>tabs</strong></span></span>
307                   </p>
308                 </td>
309                 <td>
310                   <p>
311                     端末上のタブストップの設定をクリアしたり設定したりします。
312                   </p>
313                 </td>
314               </tr>
315               <tr>
316                 <td>
317                   <p>
318                     <a id="tic" name="tic"></a><span class=
319                     "term"><span class="command"><strong>tic</strong></span></span>
320                   </p>
321                 </td>
322                 <td>
323                   <p>
324                     terminfo の定義項目に対するコンパイラーです。 これはソース形式の terminfo
325                     ファイルをバイナリ形式に変換し、ncurses ライブラリ内の処理ルーチンが利用できるようにします。
326                     terminfo ファイルは特定端末の特性に関する情報が記述されるものです。
327                   </p>
328                 </td>
329               </tr>
330               <tr>
331                 <td>
332                   <p>
333                     <a id="toe" name="toe"></a><span class=
334                     "term"><span class="command"><strong>toe</strong></span></span>
335                   </p>
336                 </td>
337                 <td>
338                   <p>
339                     利用可能なすべての端末タイプを一覧表示します。 そこでは端末名と簡単な説明を示します。
340                   </p>
341                 </td>
342               </tr>
343               <tr>
344                 <td>
345                   <p>
346                     <a id="tput" name="tput"></a><span class=
347                     "term"><span class=
348                     "command"><strong>tput</strong></span></span>
349                   </p>
350                 </td>
351                 <td>
352                   <p>
353                     端末に依存する機能設定をシェルが利用できるようにします。
354                     また端末のリセットや初期化、あるいは長い端末名称の表示も行います。
355                   </p>
356                 </td>
357               </tr>
358               <tr>
359                 <td>
360                   <p>
361                     <a id="tset" name="tset"></a><span class=
362                     "term"><span class=
363                     "command"><strong>tset</strong></span></span>
364                   </p>
365                 </td>
366                 <td>
367                   <p>
368                     端末の初期化に利用します。
369                   </p>
370                 </td>
371               </tr>
372               <tr>
373                 <td>
374                   <p>
375                     <a id="libcurses" name="libcurses"></a><span class=
376                     "term"><code class="filename">libcurses</code></span>
377                   </p>
378                 </td>
379                 <td>
380                   <p>
381                     <code class="filename">libncurses</code> へのリンク。
382                   </p>
383                 </td>
384               </tr>
385               <tr>
386                 <td>
387                   <p>
388                     <a id="libncurses" name="libncurses"></a><span class=
389                     "term"><code class="filename">libncurses</code></span>
390                   </p>
391                 </td>
392                 <td>
393                   <p>
394                     さまざまな方法により端末画面上に文字列を表示するための関数を提供します。
395                     これらの関数を用いた具体例として、カーネルの <span class="command"><strong>make
396                     menuconfig</strong></span> の実行によって表示されるメニューがあります。
397                   </p>
398                 </td>
399               </tr>
400               <tr>
401                 <td>
402                   <p>
403                     <a id="libform" name="libform"></a><span class=
404                     "term"><code class="filename">libform</code></span>
405                   </p>
406                 </td>
407                 <td>
408                   <p>
409                     フォームを実装するための関数を提供します。
410                   </p>
411                 </td>
412               </tr>
413               <tr>
414                 <td>
415                   <p>
416                     <a id="libmenu" name="libmenu"></a><span class=
417                     "term"><code class="filename">libmenu</code></span>
418                   </p>
419                 </td>
420                 <td>
421                   <p>
422                     メニューを実装するための関数を提供します。
423                   </p>
424                 </td>
425               </tr>
426               <tr>
427                 <td>
428                   <p>
429                     <a id="libpanel" name="libpanel"></a><span class=
430                     "term"><code class="filename">libpanel</code></span>
431                   </p>
432                 </td>
433                 <td>
434                   <p>
435                     パネルを実装するための関数を提供します。
436                   </p>
437                 </td>
438               </tr>
439             </tbody>
440           </table>
441         </div>
442       </div>
443     </div>
444     <div class="navfooter">
445       <ul>
446         <li class="prev">
447           <a accesskey="p" href="pkg-config.html" title=
448           "Pkg-config-0.27">前のページ</a>
449           <p>
450             Pkg-config-0.27
451           </p>
452         </li>
453         <li class="next">
454           <a accesskey="n" href="util-linux.html" title=
455           "Util-linux-2.21.2">次のページ</a>
456           <p>
457             Util-linux-2.21.2
458           </p>
459         </li>
460         <li class="up">
461           <a accesskey="u" href="chapter06.html" title=
462           "第6章 基本的なソフトウェアのインストール">上に戻る</a>
463         </li>
464         <li class="home">
465           <a accesskey="h" href="../index.html" title=
466           "Linux From Scratch - Version 7.2">ホーム</a>
467         </li>
468       </ul>
469     </div>
470   </body>
471 </html>