Files
master/chapter06/readline.html
2015-05-23 18:50:06 +08:00

239 lines
7.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content=
"application/xhtml+xml; charset=utf-8" />
<title>
6.35.&nbsp;Readline-6.3
</title>
<link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
<link rel="stylesheet" href="../stylesheets/lfs-print.css" type="text/css"
media="print" />
</head>
<body class="lfs" id="lfs-7.7-systemd">
<div class="navheader">
<h4>
Linux From Scratch - Version 7.7-systemd
</h4>
<h3>
第六章&nbsp;安装基本的系统软件
</h3>
<ul>
<li class="prev">
<a accesskey="p" href="grep.html" title="Grep-2.21">上一页</a>
<p>
Grep-2.21
</p>
</li>
<li class="next">
<a accesskey="n" href="bash.html" title="Bash-4.3.30">下一页</a>
<p>
Bash-4.3.30
</p>
</li>
<li class="up">
<a accesskey="u" href="chapter06.html" title=
"第六章&nbsp;安装基本的系统软件">返回</a>
</li>
<li class="home">
<a accesskey="h" href="../index.html" title=
"Linux From Scratch - Version 7.7-systemd">主页</a>
</li>
</ul>
</div>
<div class="wrap" lang="en" xml:lang="en">
<h1 class="sect1">
<a id="ch-system-readline" name="ch-system-readline"></a>6.35.
Readline-6.3
</h1>
<div class="package" lang="en" xml:lang="en">
<p>
Readline 软件包是提供命令行编辑和历史功能的库的集合。
</p>
<div class="segmentedlist">
<div class="seglistitem">
<div class="seg">
<strong class="segtitle">大概编译时间:</strong>
<span class="segbody">0.1 SBU</span>
</div>
<div class="seg">
<strong class="segtitle">需要磁盘空间:</strong>
<span class="segbody">24 MB</span>
</div>
</div>
</div>
</div>
<div class="installation" lang="en" xml:lang="en">
<h2 class="sect2">
6.35.1. 安装 Readline
</h2>
<p>
首先安装补丁修复一些上游标记的 bug
</p>
<pre class="userinput">
<kbd class=
"command">patch -Np1 -i ../readline-6.3-upstream_fixes-3.patch</kbd>
</pre>
<p>
重装 Readline 会使旧的库移动到 &lt;libraryname&gt;.old。
通常来说这并不是什么问题,但一些情况下可能引起
<span class=
"command"><strong>ldconfig</strong></span> 链接错误。可以通过
下面的两个 sed 命令避免这个问题:
</p>
<pre class="userinput">
<kbd class="command">sed -i '/MV.*old/d' Makefile.in
sed -i '/{OLDSUFF}/c:' support/shlib-install</kbd>
</pre>
<p>
准备编译 Readline
</p>
<pre class="userinput">
<kbd class=
"command">./configure --prefix=/usr --docdir=/usr/share/doc/readline-6.3</kbd>
</pre>
<p>
编译软件包:
</p>
<pre class="userinput">
<kbd class="command">make SHLIB_LIBS=-lncurses</kbd>
</pre>
<div class="variablelist">
<p class="title">
<strong>make 选项的含义:</strong>
</p>
<dl class="variablelist">
<dt>
<span class="term"><em class=
"parameter"><code>SHLIB_LIBS=-lncurses</code></em></span>
</dt>
<dd>
<p>
该选项强制 Readline 链接到 <code class=
"filename">libncurses</code> (实际上, <code class=
"filename">libncursesw</code>) 库。
</p>
</dd>
</dl>
</div>
<p>
该软件包没有测试套件。
</p>
<p>
安装软件包:
</p>
<pre class="userinput">
<kbd class="command">make SHLIB_LIBS=-lncurses install</kbd>
</pre>
<p>
现在移动动态库到更合适的位置并修正一些符号链接:
</p>
<pre class="userinput">
<kbd class="command">mv -v /usr/lib/lib{readline,history}.so.* /lib
ln -sfv ../../lib/$(readlink /usr/lib/libreadline.so) /usr/lib/libreadline.so
ln -sfv ../../lib/$(readlink /usr/lib/libhistory.so ) /usr/lib/libhistory.so</kbd>
</pre>
<p>
如果需要的话,安装帮助文档:
</p>
<pre class="userinput">
<kbd class=
"command">install -v -m644 doc/*.{ps,pdf,html,dvi} /usr/share/doc/readline-6.3</kbd>
</pre>
</div>
<div class="content" lang="en" xml:lang="en">
<h2 class="sect2">
<a id="contents-readline" name="contents-readline"></a>6.35.2. Readline 的内容
</h2>
<div class="segmentedlist">
<div class="seglistitem">
<div class="seg">
<strong class="segtitle">安装的库:</strong>
<span class="segbody">libhistory.{a,so} 和
libreadline.{a,so}</span>
</div>
<div class="seg">
<strong class="segtitle">安装目录:</strong>
<span class="segbody">/usr/include/readline,
/usr/share/readline, 和 /usr/share/doc/readline-6.3</span>
</div>
</div>
</div>
<div class="variablelist">
<h3>
简要介绍
</h3>
<table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top" />
<col />
</colgroup>
<tbody>
<tr>
<td>
<p>
<a id="libhistory" name="libhistory"></a><span class=
"term"><code class="filename">libhistory</code></span>
</p>
</td>
<td>
<p>
为重新查看历史行提供一致的用户界面
</p>
</td>
</tr>
<tr>
<td>
<p>
<a id="libreadline" name="libreadline"></a><span class=
"term"><code class="filename">libreadline</code></span>
</p>
</td>
<td>
<p>
在多种需要提供命令行接口的程序之间保持用户接口一致性
</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="navfooter">
<div class="book">
<div class="titlepage">
<div class="author">
<span class="firstname">翻译团队:<a href="http://lctt.github.io/" target="_blank">LCTT</a></span>
<span class="surname">译者/校对:<a href="http://github.com/ictlyh" target="_blank">ictlyh</a>,</span>
</div>
</div>
</div>
<ul>
<li class="prev">
<a accesskey="p" href="grep.html" title="Grep-2.21">上一页</a>
<p>
Grep-2.21
</p>
</li>
<li class="next">
<a accesskey="n" href="bash.html" title="Bash-4.3.30">下一页</a>
<p>
Bash-4.3.30
</p>
</li>
<li class="up">
<a accesskey="u" href="chapter06.html" title=
"第六章&nbsp;安装基本的系统软件">返回</a>
</li>
<li class="home">
<a accesskey="h" href="../index.html" title=
"Linux From Scratch - Version 7.7-systemd">主页</a>
</li>
</ul>
</div>
</body>
</html>