Added several sections to chapter 6 (Добавлено несколько разделов в главу 6)

This commit is contained in:
Vladimir Pertsev 2022-05-24 01:04:50 +05:00
parent c486df5d76
commit f1bc347e8f
16 changed files with 1294 additions and 1 deletions

91
chapter06/bash.xml Normal file
View File

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-tools-bash" role="wrap">
<?dbhtml filename="bash.html"?>
<sect1info condition="script">
<productname>bash</productname>
<productnumber>&bash-version;</productnumber>
<address>&bash-url;</address>
</sect1info>
<title>Bash-&bash-version;</title>
<indexterm zone="ch-tools-bash">
<primary sortas="a-Bash">Bash</primary>
<secondary>tools</secondary>
</indexterm>
<sect2 role="package">
<title/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
href="../chapter08/bash.xml"
xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
<seglistitem>
<seg>&bash-tmp-sbu;</seg>
<seg>&bash-tmp-du;</seg>
</seglistitem>
</segmentedlist>
</sect2>
<sect2 role="installation">
<title>Установка пакета Bash</title>
<para>Подготовьте Bash к компиляции:</para>
<screen><userinput remap="configure">./configure --prefix=/usr \
--build=$(support/config.guess) \
--host=$LFS_TGT \
--without-bash-malloc</userinput></screen>
<variablelist>
<title>Значение параметров настройки:</title>
<varlistentry>
<term><parameter>--without-bash-malloc</parameter></term>
<listitem>
<para>Этот параметр отключает использование функции распределения
памяти (<function>malloc</function>) Bash, которая, как известно,
вызывает ошибки сегментации. Если опция отключена, Bash будет
использовать функции <function>malloc</function> из Glibc, которые более стабильны.</para>
</listitem>
</varlistentry>
</variablelist>
<para>Скомпилируйте пакет:</para>
<screen><userinput remap="make">make</userinput></screen>
<para>Установите пакет:</para>
<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
<para>Создайте символическую ссылку для программ, которые используют
<command>sh</command> как оболочку:</para>
<screen><userinput remap="install">ln -sv bash $LFS/bin/sh</userinput></screen>
</sect2>
<sect2 role="content">
<title/>
<para>Подробная информация об этом пакете находится в
<xref linkend="contents-bash" role="."/></para>
</sect2>
</sect1>

View File

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-tools-binutils-pass2" role="wrap">
<?dbhtml filename="binutils-pass2.html"?>
<sect1info condition="script">
<productname>binutils-pass2</productname>
<productnumber>&binutils-version;</productnumber>
<address>&binutils-url;</address>
</sect1info>
<title>Binutils-&binutils-version; - Проход 2</title>
<indexterm zone="ch-tools-binutils-pass2">
<primary sortas="a-Binutils">Binutils</primary>
<secondary>tools, pass 2</secondary>
</indexterm>
<sect2 role="package">
<title/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
href="../chapter08/binutils.xml"
xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
<seglistitem>
<seg>&binutils-tmpp2-sbu;</seg>
<seg>&binutils-tmpp2-du;</seg>
</seglistitem>
</segmentedlist>
</sect2>
<sect2 role="installation">
<title>Установка пакета Binutils</title>
<!-- Don't remove this until Binutils upstream updates the libtool
copy. On some host distros the issue doesn't show up. -->
<para>Binutils поставляет устаревшую версию libtool в архиве. В нем отсутствует
поддержка sysroot, поэтому созданные двоичные файлы будут ошибочно связаны с
библиотеками из основного дистрибутива. Решение этой проблемы:</para>
<screen><userinput remap="pre">sed '6009s/$add_dir//' -i ltmain.sh</userinput></screen>
<para>Создайте отдельный каталог для сборки:</para>
<screen><userinput remap="pre">mkdir -v build
cd build</userinput></screen>
<para>Подготовьте Binutils к компиляции:</para>
<screen><userinput remap="configure">../configure \
--prefix=/usr \
--build=$(../config.guess) \
--host=$LFS_TGT \
--disable-nls \
--enable-shared \
--disable-werror \
--enable-64-bit-bfd</userinput></screen>
<variablelist>
<title>Значение новых параметров настройки:</title>
<varlistentry>
<term><parameter>--enable-shared</parameter></term>
<listitem>
<para>Собирает <filename
class="libraryfile">libbfd</filename> как разделяемую библиотеку</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>--enable-64-bit-bfd</parameter></term>
<listitem>
<para>Включает 64-разрядную поддержку (на хостах с более узким размером
слов). Может и не понадобиться в 64-разрядных системах, но вреда от этого не будет.</para>
</listitem>
</varlistentry>
</variablelist>
<para>Скомпилируйте пакет:</para>
<screen><userinput remap="make">make</userinput></screen>
<para>Установите пакет:</para>
<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
</sect2>
<sect2 role="content">
<title/>
<para>Подробная информация об этом пакете находится в
<xref linkend="contents-binutils" role="."/></para>
</sect2>
</sect1>

101
chapter06/coreutils.xml Normal file
View File

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-tools-coreutils" role="wrap">
<?dbhtml filename="coreutils.html"?>
<sect1info condition="script">
<productname>coreutils</productname>
<productnumber>&coreutils-version;</productnumber>
<address>&coreutils-url;</address>
</sect1info>
<title>Coreutils-&coreutils-version;</title>
<indexterm zone="ch-tools-coreutils">
<primary sortas="a-Coreutils">Coreutils</primary>
<secondary>tools</secondary>
</indexterm>
<sect2 role="package">
<title/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
href="../chapter08/coreutils.xml"
xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
<seglistitem>
<seg>&coreutils-tmp-sbu;</seg>
<seg>&coreutils-tmp-du;</seg>
</seglistitem>
</segmentedlist>
</sect2>
<sect2 role="installation">
<title>Установка пакета Coreutils</title>
<para>Подготовьте Coreutils к компиляции:</para>
<screen><userinput remap="configure">./configure --prefix=/usr \
--host=$LFS_TGT \
--build=$(build-aux/config.guess) \
--enable-install-program=hostname \
--enable-no-install-program=kill,uptime</userinput></screen>
<variablelist>
<title>Значение параметров настройки:</title>
<varlistentry>
<term><envar>--enable-install-program=hostname</envar></term>
<listitem>
<para>Это позволяет создать и установить двоичный файл
<command>hostname</command> &ndash; по умолчанию он отключен, но
требуется для набора тестов Perl.</para>
</listitem>
</varlistentry>
</variablelist>
<para>Скомпилируйте пакет:</para>
<screen><userinput remap="make">make</userinput></screen>
<para>Установите пакет:</para>
<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
<!--
<para>The above command refuses to install <filename>su</filename>
because the program cannot be installed setuid root as a non-privileged
user. By manually installing it, we can use it for running tests in the
final system as a non-privileged user. Install it with:</para>
<screen><userinput remap="install">cp -v src/su /tools/bin</userinput></screen>
-->
<para>Переместите программы в их конечное местоположение. Хотя во временной среде в
этом нет необходимости, мы должны это сделать, потому что некоторые программы жестко
прописывают местоположение исполняемых файлов:</para>
<screen><userinput remap="install">mv -v $LFS/usr/bin/chroot $LFS/usr/sbin
mkdir -pv $LFS/usr/share/man/man8
mv -v $LFS/usr/share/man/man1/chroot.1 $LFS/usr/share/man/man8/chroot.8
sed -i 's/"1"/"8"/' $LFS/usr/share/man/man8/chroot.8</userinput></screen>
</sect2>
<sect2 role="content">
<title/>
<para>Подробная информация об этом пакете находится в
<xref linkend="contents-coreutils" role="."/></para>
</sect2>
</sect1>

68
chapter06/diffutils.xml Normal file
View File

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-tools-diffutils" role="wrap">
<?dbhtml filename="diffutils.html"?>
<sect1info condition="script">
<productname>diffutils</productname>
<productnumber>&diffutils-version;</productnumber>
<address>&diffutils-url;</address>
</sect1info>
<title>Diffutils-&diffutils-version;</title>
<indexterm zone="ch-tools-diffutils">
<primary sortas="a-Diffutils">Diffutils</primary>
<secondary>tools</secondary>
</indexterm>
<sect2 role="package">
<title/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
href="../chapter08/diffutils.xml"
xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
<seglistitem>
<seg>&diffutils-tmp-sbu;</seg>
<seg>&diffutils-tmp-du;</seg>
</seglistitem>
</segmentedlist>
</sect2>
<sect2 role="installation">
<title>Установка пакета Diffutils</title>
<para>Подготовьте Diffutils для компиляции:</para>
<screen><userinput remap="configure">./configure --prefix=/usr --host=$LFS_TGT</userinput></screen>
<para>Скомпилируйте пакет:</para>
<screen><userinput remap="make">make</userinput></screen>
<para>Установите пакет:</para>
<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
</sect2>
<sect2 role="content">
<title/>
<para>Подробная информация об этом пакете находится в
<xref linkend="contents-diffutils" role="."/></para>
</sect2>
</sect1>

100
chapter06/file.xml Normal file
View File

@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-tools-file" role="wrap">
<?dbhtml filename="file.html"?>
<sect1info condition="script">
<productname>file</productname>
<productnumber>&file-version;</productnumber>
<address>&file-url;</address>
</sect1info>
<title>File-&file-version;</title>
<indexterm zone="ch-tools-file">
<primary sortas="a-File">File</primary>
<secondary>tools</secondary>
</indexterm>
<sect2 role="package">
<title/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
href="../chapter08/file.xml"
xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
<seglistitem>
<seg>&file-tmp-sbu;</seg>
<seg>&file-tmp-du;</seg>
</seglistitem>
</segmentedlist>
</sect2>
<sect2 role="installation">
<title>Установка пакета File</title>
<para>
Команда <command>file</command> на хосте сборки должна быть той же версии, что и
собираемая, чтобы создать файл подписи. Запустите следующие команды, для сборки пакета:
</para>
<screen><userinput remap="pre">mkdir build
pushd build
../configure --disable-bzlib \
--disable-libseccomp \
--disable-xzlib \
--disable-zlib
make
popd</userinput></screen>
<variablelist>
<title>Значение новой опции настройки:</title>
<varlistentry>
<term><parameter>--disable-*</parameter></term>
<listitem>
<para>Сценарий конфигурации пытается использовать некоторые пакеты из
основного дистрибутива, если существуют соответствующие файлы библиотек.
Это может привести к сбою компиляции, если файлы библиотек существует,
но отсутствуют соответствующие заголовочные файлы. Эти параметры
предотвращают использование ненужных возможностей хоста.</para>
</listitem>
</varlistentry>
</variablelist>
<para>Подготовьте файл для компиляции:</para>
<screen><userinput remap="configure">./configure --prefix=/usr --host=$LFS_TGT --build=$(./config.guess)</userinput></screen>
<!-- devs: if using - -build here, the build system wants to compile
the signature file with "file" on the build system, but stops if it is not
the same version. One possibility would be to build "file" on the build
system first, but it is simpler to have the system think it is not
cross-compiling, and use the just built "file". -->
<para>Скомпилируйте пакет:</para>
<screen><userinput remap="make">make FILE_COMPILE=$(pwd)/build/src/file</userinput></screen>
<para>Установите пакет:</para>
<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
</sect2>
<sect2 role="content">
<title/>
<para>Подробная информация об этом пакете находится в <xref linkend="contents-file" role="."/></para>
</sect2>
</sect1>

71
chapter06/findutils.xml Normal file
View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-tools-findutils" role="wrap">
<?dbhtml filename="findutils.html"?>
<sect1info condition="script">
<productname>findutils</productname>
<productnumber>&findutils-version;</productnumber>
<address>&findutils-url;</address>
</sect1info>
<title>Findutils-&findutils-version;</title>
<indexterm zone="ch-tools-findutils">
<primary sortas="a-Findutils">Findutils</primary>
<secondary>tools</secondary>
</indexterm>
<sect2 role="package">
<title/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
href="../chapter08/findutils.xml"
xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
<seglistitem>
<seg>&findutils-tmp-sbu;</seg>
<seg>&findutils-tmp-du;</seg>
</seglistitem>
</segmentedlist>
</sect2>
<sect2 role="installation">
<title>Установка пакета Findutils</title>
<para>Подготовьте Findutils к компиляции:</para>
<screen><userinput remap="configure">./configure --prefix=/usr \
--localstatedir=/var/lib/locate \
--host=$LFS_TGT \
--build=$(build-aux/config.guess)</userinput></screen>
<para>Скомпилируйте пакет:</para>
<screen><userinput remap="make">make</userinput></screen>
<para>Установите пакет:</para>
<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
</sect2>
<sect2 role="content">
<title/>
<para>Подробная информация об этом пакете находится в
<xref linkend="contents-findutils" role="."/></para>
</sect2>
</sect1>

74
chapter06/gawk.xml Normal file
View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-tools-gawk" role="wrap">
<?dbhtml filename="gawk.html"?>
<sect1info condition="script">
<productname>gawk</productname>
<productnumber>&gawk-version;</productnumber>
<address>&gawk-url;</address>
</sect1info>
<title>Gawk-&gawk-version;</title>
<indexterm zone="ch-tools-gawk">
<primary sortas="a-Gawk">Gawk</primary>
<secondary>tools</secondary>
</indexterm>
<sect2 role="package">
<title/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
href="../chapter08/gawk.xml"
xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
<seglistitem>
<seg>&gawk-tmp-sbu;</seg>
<seg>&gawk-tmp-du;</seg>
</seglistitem>
</segmentedlist>
</sect2>
<sect2 role="installation">
<title>Установка пакета Gawk</title>
<para>Во-первых, убедитесь, что некоторые ненужные файлы не будут установлены:</para>
<screen><userinput remap="pre">sed -i 's/extras//' Makefile.in</userinput></screen>
<para>Подготовьте Gawk к компиляции:</para>
<screen><userinput remap="configure">./configure --prefix=/usr \
--host=$LFS_TGT \
--build=$(build-aux/config.guess)</userinput></screen>
<para>Скомпилируйте пакет:</para>
<screen><userinput remap="make">make</userinput></screen>
<para>Установите пакет:</para>
<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
</sect2>
<sect2 role="content">
<title/>
<para>Подробная информация об этом пакете находится в
<xref linkend="contents-gawk" role="."/></para>
</sect2>
</sect1>

178
chapter06/gcc-pass2.xml Normal file
View File

@ -0,0 +1,178 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-tools-gcc-pass2" role="wrap" xreflabel="gcc-pass2">
<?dbhtml filename="gcc-pass2.html"?>
<sect1info condition="script">
<productname>gcc-pass2</productname>
<productnumber>&gcc-version;</productnumber>
<address>&gcc-url;</address>
</sect1info>
<title>GCC-&gcc-version; - Проход 2</title>
<indexterm zone="ch-tools-gcc-pass2">
<primary sortas="a-GCC">GCC</primary>
<secondary>tools, pass 2</secondary>
</indexterm>
<sect2 role="package">
<title/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
href="../chapter08/gcc.xml"
xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
<seglistitem>
<seg>&gcc-tmpp2-sbu;</seg>
<seg>&gcc-tmpp2-du;</seg>
</seglistitem>
</segmentedlist>
</sect2>
<sect2 role="installation">
<title>Установка пакета GCC</title>
<para>Как и при первой сборке GCC, требуются пакеты GMP, MPFR и MPC. Распакуйте
архивы и переместите их в каталоги с нужными именами:</para>
<screen><userinput remap="pre">tar -xf ../mpfr-&mpfr-version;.tar.xz
mv -v mpfr-&mpfr-version; mpfr
tar -xf ../gmp-&gmp-version;.tar.xz
mv -v gmp-&gmp-version; gmp
tar -xf ../mpc-&mpc-version;.tar.gz
mv -v mpc-&mpc-version; mpc</userinput></screen>
<para>При сборке на x86_64 измените имя каталога по умолчанию для 64-разрядных
библиотек на <quote>lib</quote>.:</para>
<screen><userinput remap="pre">case $(uname -m) in
x86_64)
sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64
;;
esac</userinput></screen>
<para>Переопределите правила сборки заголовочных файлов libgcc и libstdc++, чтобы
разрешить создание этих библиотек с поддержкой потоков POSIX:</para>
<screen><userinput remap="pre">sed '/thread_header =/s/@.*@/gthr-posix.h/' \
-i libgcc/Makefile.in libstdc++-v3/include/Makefile.in</userinput></screen>
<para>Снова создайте отдельный каталог сборки:</para>
<screen><userinput remap="pre">mkdir -v build
cd build</userinput></screen>
<para>Перед началом сборки GCC не забудьте отключить все переменные среды,
которые переопределяют флаги оптимизации по умолчанию.</para>
<para>Теперь подготовьте GCC к компиляции:</para>
<screen><userinput remap="configure">../configure \
--build=$(../config.guess) \
--host=$LFS_TGT \
--target=$LFS_TGT \
LDFLAGS_FOR_TARGET=-L$PWD/$LFS_TGT/libgcc \
--prefix=/usr \
--with-build-sysroot=$LFS \
--enable-initfini-array \
--disable-nls \
--disable-multilib \
--disable-decimal-float \
--disable-libatomic \
--disable-libgomp \
--disable-libquadmath \
--disable-libssp \
--disable-libvtv \
--enable-languages=c,c++</userinput></screen>
<variablelist>
<title>Значение новых параметров настройки:</title><!-- WIP -->
<varlistentry>
<term><parameter>--with-build-sysroot=$LFS</parameter></term>
<listitem>
<para>Обычно, использование <parameter>--host</parameter> гарантирует, что
для сборки GCC используется кросс-компилятор, и этот компилятор знает,
что он должен искать заголовочные файлы и библиотеки в <filename
class="directory">$LFS</filename>. Но сборочная система GCC использует
другие инструменты, которые не знают об этом местоположении. Этот
переключатель необходим для того, чтобы они могли находить нужные файлы в <filename
class="directory">$LFS</filename>, а не на хосте.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>--target=$LFS_TGT</parameter></term>
<listitem>
<para>Поскольку мы выполняем кросс-компиляцию GCC, невозможно создать
целевые библиотеки (<filename class="libraryfile">libgcc</filename>
и <filename class="libraryfile">libstdc++</filename>) со скомпилированными
двоичными файлами GCC, потому что эти двоичные файлы не будут работать на
хост-дистрибутиве. Система сборки GCC попытается использовать
компиляторы C и C++ в хост-дистрибутиве в качестве обходного пути.
Сейчас не поддерживается создание целевых библиотек GCC с другими версиями GCC,
поэтому использование хост-компиляторов может привести к отказу сборки. Этот
параметр обеспечивает сборку библиотек с помощью GCC собранного на первом проходе,
чтобы предотвратить проблему</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>LDFLAGS_FOR_TARGET=...</parameter></term>
<listitem>
<para>Разрешить <filename class="libraryfile">libstdc++</filename> использовать
общую библиотеку <filename class="libraryfile">libgcc</filename>,
собранную на этом проходе, вместо статической версии, собранной в GCC
Проход 1. Это необходимо для поддержки обработки исключения C++</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>--enable-initfini-array</parameter></term>
<listitem>
<para>Эта опция включается автоматически при сборке собственного
компилятора с родным компилятором на x86. Но сейчас мы собираем с помощью
кросс-компилятора, поэтому нам нужно явно включить эту опцию.</para>
</listitem>
</varlistentry>
</variablelist>
<para>Скомпилируйте пакет:</para>
<screen><userinput remap="make">make</userinput></screen>
<para>Установите пакет:</para>
<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
<para>В качестве завершающего штриха создайте символическую ссылку на утилиту.
Многие программы и скрипты используют <command>cc</command> вместо <command>gcc</command>,
чтобы сделать программы более универсальными и, следовательно, для соместимости со всеми
типами UNIX-систем, где компилятор GNU C не всегда установлен. Наличие <command>cc</command>
оставляет системному администратору право самостоятельно решать, какой компилятор C устанавливать:</para>
<screen><userinput remap="install">ln -sv gcc $LFS/usr/bin/cc</userinput></screen>
</sect2>
<sect2 role="content">
<title/>
<para>Подробная информация об этом пакете находится в
<xref linkend="contents-gcc" role="."/></para>
</sect2>
</sect1>

70
chapter06/grep.xml Normal file
View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-tools-grep" role="wrap">
<?dbhtml filename="grep.html"?>
<sect1info condition="script">
<productname>grep</productname>
<productnumber>&grep-version;</productnumber>
<address>&grep-url;</address>
</sect1info>
<title>Grep-&grep-version;</title>
<indexterm zone="ch-tools-grep">
<primary sortas="a-Grep">Grep</primary>
<secondary>tools</secondary>
</indexterm>
<sect2 role="package">
<title/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
href="../chapter08/grep.xml"
xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
<seglistitem>
<seg>&grep-tmp-sbu;</seg>
<seg>&grep-tmp-du;</seg>
</seglistitem>
</segmentedlist>
</sect2>
<sect2 role="installation">
<title>Установка пакета Grep</title>
<para>Подготовьте Grep к компиляции:
</para>
<screen><userinput remap="configure">./configure --prefix=/usr \
--host=$LFS_TGT</userinput></screen>
<para>Скомпилируйте пакет:</para>
<screen><userinput remap="make">make</userinput></screen>
<para>Установите пакет:</para>
<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
</sect2>
<sect2 role="content">
<title/>
<para>Подробная информация об этом пакете находится в
<xref linkend="contents-grep" role="."/></para>
</sect2>
</sect1>

68
chapter06/gzip.xml Normal file
View File

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-tools-gzip" role="wrap">
<?dbhtml filename="gzip.html"?>
<sect1info condition="script">
<productname>gzip</productname>
<productnumber>&gzip-version;</productnumber>
<address>&gzip-url;</address>
</sect1info>
<title>Gzip-&gzip-version;</title>
<indexterm zone="ch-tools-gzip">
<primary sortas="a-Gzip">Gzip</primary>
<secondary>tools</secondary>
</indexterm>
<sect2 role="package">
<title/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
href="../chapter08/gzip.xml"
xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
<seglistitem>
<seg>&gzip-tmp-sbu;</seg>
<seg>&gzip-tmp-du;</seg>
</seglistitem>
</segmentedlist>
</sect2>
<sect2 role="installation">
<title>Установка пакета Gzip</title>
<para>Подготовьте Gzip к компиляции:</para>
<screen><userinput remap="configure">./configure --prefix=/usr --host=$LFS_TGT</userinput></screen>
<para>Скомпилируйте пакет:</para>
<screen><userinput remap="make">make</userinput></screen>
<para>Установите пакет:</para>
<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
</sect2>
<sect2 role="content">
<title/>
<para>Подробная информация об этом пакете находится в
<xref linkend="contents-gzip" role="."/></para>
</sect2>
</sect1>

83
chapter06/make.xml Normal file
View File

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-tools-make" role="wrap">
<?dbhtml filename="make.html"?>
<sect1info condition="script">
<productname>make</productname>
<productnumber>&make-version;</productnumber>
<address>&make-url;</address>
</sect1info>
<title>Make-&make-version;</title>
<indexterm zone="ch-tools-make">
<primary sortas="a-Make">Make</primary>
<secondary>tools</secondary>
</indexterm>
<sect2 role="package">
<title/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
href="../chapter08/make.xml"
xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
<seglistitem>
<seg>&make-tmp-sbu;</seg>
<seg>&make-tmp-du;</seg>
</seglistitem>
</segmentedlist>
</sect2>
<sect2 role="installation">
<title>Установка пакета Make</title>
<para>Подготовьте Make к компиляции:</para>
<screen><userinput remap="configure">./configure --prefix=/usr \
--without-guile \
--host=$LFS_TGT \
--build=$(build-aux/config.guess)</userinput></screen>
<variablelist>
<title>Значение новой опции настройки:</title>
<varlistentry>
<term><parameter>--without-guile</parameter></term>
<listitem>
<para>Несмотря на то, что мы выполняем кросс-компиляцию, configure
пытается использовать guile с узла сборки, если он его находит. Это
приводит к сбою компиляции, этот аргумент предотвращает его использование.</para>
</listitem>
</varlistentry>
</variablelist>
<para>Скомпилируйте пакет:</para>
<screen><userinput remap="make">make</userinput></screen>
<para>Установите пакет:</para>
<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
</sect2>
<sect2 role="content">
<title/>
<para>Подробная информация об этом пакете находится в
<xref linkend="contents-make" role="."/></para>
</sect2>
</sect1>

View File

@ -41,7 +41,7 @@
</sect2>
<sect2 role="installation">
<title>Установка Ncurses</title>
<title>Установка пакета Ncurses</title>
<para>Во-первых, убедитесь, что <command>gawk</command> найден первым во время настройки:</para>

71
chapter06/patch.xml Normal file
View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-tools-patch" role="wrap">
<?dbhtml filename="patch.html"?>
<sect1info condition="script">
<productname>patch</productname>
<productnumber>&patch-version;</productnumber>
<address>&patch-url;</address>
</sect1info>
<title>Patch-&patch-version;</title>
<indexterm zone="ch-tools-patch">
<primary sortas="a-Patch">Patch</primary>
<secondary>tools</secondary>
</indexterm>
<sect2 role="package">
<title/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
href="../chapter08/patch.xml"
xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
<seglistitem>
<seg>&patch-tmp-sbu;</seg>
<seg>&patch-tmp-du;</seg>
</seglistitem>
</segmentedlist>
</sect2>
<sect2 role="installation">
<title>Установка пакета Patch</title>
<para>Подготовьте Patch к компиляции:
</para>
<screen><userinput remap="configure">./configure --prefix=/usr \
--host=$LFS_TGT \
--build=$(build-aux/config.guess)</userinput></screen>
<para>Скомпилируйте пакет:</para>
<screen><userinput remap="make">make</userinput></screen>
<para>Установите пакет:</para>
<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
</sect2>
<sect2 role="content">
<title/>
<para>Подробная информация об этом пакете находится в
<xref linkend="contents-patch" role="."/></para>
</sect2>
</sect1>

69
chapter06/sed.xml Normal file
View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-tools-sed" role="wrap">
<?dbhtml filename="sed.html"?>
<sect1info condition="script">
<productname>sed</productname>
<productnumber>&sed-version;</productnumber>
<address>&sed-url;</address>
</sect1info>
<title>Sed-&sed-version;</title>
<indexterm zone="ch-tools-sed">
<primary sortas="a-Sed">Sed</primary>
<secondary>tools</secondary>
</indexterm>
<sect2 role="package">
<title/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
href="../chapter08/sed.xml"
xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
<seglistitem>
<seg>&sed-tmp-sbu;</seg>
<seg>&sed-tmp-du;</seg>
</seglistitem>
</segmentedlist>
</sect2>
<sect2 role="installation">
<title>Установка пакета Sed</title>
<para>Подготовьте Sed к компиляции:</para>
<screen><userinput remap="configure">./configure --prefix=/usr \
--host=$LFS_TGT</userinput></screen>
<para>Скомпилируйте пакет:</para>
<screen><userinput remap="make">make</userinput></screen>
<para>Установите пакет:</para>
<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
</sect2>
<sect2 role="content">
<title/>
<para>Подробная информация об этом пакете находится в
<xref linkend="contents-sed" role="."/></para>
</sect2>
</sect1>

69
chapter06/tar.xml Normal file
View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-tools-tar" role="wrap">
<?dbhtml filename="tar.html"?>
<sect1info condition="script">
<productname>tar</productname>
<productnumber>&tar-version;</productnumber>
<address>&tar-url;</address>
</sect1info>
<title>Tar-&tar-version;</title>
<indexterm zone="ch-tools-tar">
<primary sortas="a-Tar">Tar</primary>
<secondary>tools</secondary>
</indexterm>
<sect2 role="package">
<title/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
href="../chapter08/tar.xml"
xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
<seglistitem>
<seg>&tar-tmp-sbu;</seg>
<seg>&tar-tmp-du;</seg>
</seglistitem>
</segmentedlist>
</sect2>
<sect2 role="installation">
<title>Установка пакета Tar</title>
<para>Подготовьте Tar к компиляции:</para>
<screen><userinput remap="configure">./configure --prefix=/usr \
--host=$LFS_TGT \
--build=$(build-aux/config.guess)</userinput></screen>
<para>Скомпилируйте пакет:</para>
<screen><userinput remap="make">make</userinput></screen>
<para>Установите пакет:</para>
<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
</sect2>
<sect2 role="content">
<title/>
<para>Подробная информация об этом пакете находится в <xref linkend="contents-tar" role="."/></para>
</sect2>
</sect1>

70
chapter06/xz.xml Normal file
View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-tools-xz" role="wrap">
<?dbhtml filename="xz.html"?>
<sect1info condition="script">
<productname>xz</productname>
<productnumber>&xz-version;</productnumber>
<address>&xz-url;</address>
</sect1info>
<title>Xz-&xz-version;</title>
<indexterm zone="ch-tools-xz">
<primary sortas="a-xz">Xz</primary>
<secondary>tools</secondary>
</indexterm>
<sect2 role="package">
<title/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
href="../chapter08/xz.xml"
xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
<seglistitem>
<seg>&xz-tmp-sbu;</seg>
<seg>&xz-tmp-du;</seg>
</seglistitem>
</segmentedlist>
</sect2>
<sect2 role="installation">
<title>Установка пакета Xz</title>
<para>Подготовьте Xz к компиляции:</para>
<screen><userinput remap="configure">./configure --prefix=/usr \
--host=$LFS_TGT \
--build=$(build-aux/config.guess) \
--disable-static \
--docdir=/usr/share/doc/xz-&xz-version;</userinput></screen>
<para>Скомпилируйте пакет:</para>
<screen><userinput remap="make">make</userinput></screen>
<para>Установите пакет:</para>
<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
</sect2>
<sect2 role="content">
<title/>
<para>Подробная информация об этом пакете находится в <xref linkend="contents-xz" role="."/></para>
</sect2>
</sect1>