[7152faa] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
[3c63868] | 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 |
|
---|
[12fff1e] | 8 | <sect1 id="ch-tools-generalinstructions"
|
---|
| 9 | xreflabel="General Compilation Instructions">
|
---|
[3c63868] | 10 | <?dbhtml filename="generalinstructions.html"?>
|
---|
| 11 |
|
---|
| 12 | <title>General Compilation Instructions</title>
|
---|
| 13 |
|
---|
[1ec60f1d] | 14 | <caution>
|
---|
| 15 | <para>
|
---|
| 16 | During a development cycle of LFS, the instructions in the book are
|
---|
| 17 | often modified to adapt for a package update or take the advantage of
|
---|
| 18 | new features from updated packages. Mixing up the instructions of
|
---|
| 19 | different versions of the LFS book can cause subtle breakages. This
|
---|
| 20 | kind of issue is generally a result from reusing some script created
|
---|
| 21 | for a prior LFS release. Such a reuse is strongly discouraged. If
|
---|
| 22 | you are reusing scripts for a prior LFS release for any reason, you'll
|
---|
| 23 | need to be very careful to update the scripts to match current version
|
---|
| 24 | of the LFS book.
|
---|
| 25 | </para>
|
---|
| 26 | </caution>
|
---|
| 27 |
|
---|
[cc0e77d] | 28 | <para>Here are some things you should know about building each package:</para>
|
---|
[3c63868] | 29 |
|
---|
| 30 | <itemizedlist>
|
---|
| 31 |
|
---|
| 32 | <listitem>
|
---|
[cc0e77d] | 33 | <para>Several packages are patched before compilation, but only when
|
---|
[3c63868] | 34 | the patch is needed to circumvent a problem. A patch is often needed in
|
---|
[cc0e77d] | 35 | both the current and the following chapters, but sometimes, when the same package
|
---|
| 36 | is built more than once, the patch is not needed right away.
|
---|
[3c63868] | 37 | Therefore, do not be concerned if instructions for a downloaded patch seem
|
---|
| 38 | to be missing. Warning messages about <emphasis>offset</emphasis> or
|
---|
| 39 | <emphasis>fuzz</emphasis> may also be encountered when applying a patch. Do
|
---|
[cc0e77d] | 40 | not worry about these warnings; the patch was still successfully
|
---|
[3c63868] | 41 | applied.</para>
|
---|
| 42 | </listitem>
|
---|
| 43 |
|
---|
| 44 | <listitem>
|
---|
[cc0e77d] | 45 | <para>During the compilation of most packages, some
|
---|
| 46 | warnings will scroll by on the screen. These are normal and can safely be
|
---|
| 47 | ignored. These warnings are usually about
|
---|
[3c63868] | 48 | deprecated, but not invalid, use of the C or C++ syntax. C standards change
|
---|
[cc0e77d] | 49 | fairly often, and some packages have not yet been updated. This is not a
|
---|
| 50 | serious problem, but it does cause the warnings to appear.</para>
|
---|
[3c63868] | 51 | </listitem>
|
---|
| 52 |
|
---|
| 53 | <listitem>
|
---|
| 54 | <para>Check one last time that the <envar>LFS</envar> environment variable
|
---|
| 55 | is set up properly:</para>
|
---|
| 56 |
|
---|
| 57 | <screen role="nodump"><userinput>echo $LFS</userinput></screen>
|
---|
| 58 |
|
---|
| 59 | <para>Make sure the output shows the path to the LFS partition's mount
|
---|
| 60 | point, which is <filename class="directory">/mnt/lfs</filename>, using our
|
---|
| 61 | example.</para>
|
---|
| 62 | </listitem>
|
---|
| 63 |
|
---|
| 64 | <listitem>
|
---|
| 65 |
|
---|
[0d84af1] | 66 | <para>Finally, two important items must be emphasized:</para>
|
---|
[16471f8] | 67 |
|
---|
| 68 | <important>
|
---|
[79bfd82] | 69 |
|
---|
| 70 | <para>The build instructions assume that the <xref
|
---|
[afcfd74] | 71 | linkend='ch-partitioning-hostreqs'/>, including symbolic links, have
|
---|
| 72 | been set properly:</para>
|
---|
[2ca8941] | 73 |
|
---|
[79bfd82] | 74 | <itemizedlist role='important'>
|
---|
| 75 |
|
---|
| 76 | <listitem override='bullet'><para><command>bash</command> is the shell
|
---|
| 77 | in use.</para></listitem>
|
---|
[2ca8941] | 78 |
|
---|
[79bfd82] | 79 | <listitem override='bullet'><para><command>sh</command> is a symbolic
|
---|
| 80 | link to <command>bash</command>.</para></listitem>
|
---|
| 81 |
|
---|
| 82 | <listitem override='bullet'><para><command>/usr/bin/awk</command> is a
|
---|
| 83 | symbolic link to <command>gawk</command>.</para></listitem>
|
---|
| 84 |
|
---|
| 85 | <listitem override='bullet'><para><command>/usr/bin/yacc</command> is a
|
---|
[cc0e77d] | 86 | symbolic link to <command>bison</command>, or to a small script that
|
---|
[79bfd82] | 87 | executes bison.</para></listitem>
|
---|
| 88 |
|
---|
| 89 | </itemizedlist>
|
---|
[16471f8] | 90 | </important>
|
---|
[3c63868] | 91 |
|
---|
| 92 | <important>
|
---|
[cc0e77d] | 93 | <para>Here is a synopsis of the build process.</para>
|
---|
[4df26333] | 94 |
|
---|
| 95 | <orderedlist numeration="arabic" spacing="compact">
|
---|
| 96 | <listitem>
|
---|
| 97 | <para>Place all the sources and patches in a directory that will be
|
---|
[cc0e77d] | 98 | accessible from the chroot environment, such as
|
---|
[c37e846] | 99 | <filename class="directory">/mnt/lfs/sources/</filename>.<!-- Do
|
---|
[4df26333] | 100 | <emphasis>not</emphasis> put sources in
|
---|
[c37e846] | 101 | <filename class="directory">/mnt/lfs/tools/</filename>. --></para>
|
---|
[4df26333] | 102 | </listitem>
|
---|
| 103 | <listitem>
|
---|
[cc0e77d] | 104 | <para>Change to the <filename class="directory">/mnt/lfs/sources/</filename> directory.</para>
|
---|
[4df26333] | 105 | </listitem>
|
---|
[3380af3] | 106 | <listitem id='buildinstr' xreflabel='Package build instructions'>
|
---|
[4df26333] | 107 | <para>For each package:</para>
|
---|
| 108 | <orderedlist numeration="loweralpha" spacing="compact">
|
---|
| 109 | <listitem>
|
---|
| 110 | <para>Using the <command>tar</command> program, extract the package
|
---|
[3543e03] | 111 | to be built. In <xref linkend="chapter-cross-tools"/> and
|
---|
[a665a20] | 112 | <xref linkend="chapter-temporary-tools"/>, ensure you are
|
---|
[79524a0] | 113 | the <emphasis>lfs</emphasis> user when extracting the package.</para>
|
---|
[cc0e77d] | 114 | <para>Do not use any method except the <command>tar</command> command
|
---|
| 115 | to extract the source code. Notably, using the <command>cp -R</command>
|
---|
| 116 | command to copy the
|
---|
[9977b8f] | 117 | source code tree somewhere else can destroy
|
---|
[cc0e77d] | 118 | timestamps in the source tree, and cause the build to fail.</para>
|
---|
[4df26333] | 119 | </listitem>
|
---|
| 120 | <listitem>
|
---|
| 121 | <para>Change to the directory created when the package was
|
---|
| 122 | extracted.</para>
|
---|
| 123 | </listitem>
|
---|
| 124 | <listitem>
|
---|
[cc0e77d] | 125 | <para>Follow the instructions for building the package.</para>
|
---|
[4df26333] | 126 | </listitem>
|
---|
| 127 | <listitem>
|
---|
[cc0e77d] | 128 | <para>Change back to the sources directory when the build is complete.</para>
|
---|
[4df26333] | 129 | </listitem>
|
---|
| 130 | <listitem>
|
---|
[f1dd547] | 131 | <para>Delete the extracted source directory unless instructed otherwise.</para>
|
---|
[4df26333] | 132 | </listitem>
|
---|
| 133 | </orderedlist>
|
---|
| 134 | </listitem>
|
---|
| 135 | </orderedlist>
|
---|
[3c63868] | 136 | </important>
|
---|
| 137 | </listitem>
|
---|
| 138 |
|
---|
| 139 | </itemizedlist>
|
---|
| 140 |
|
---|
| 141 | </sect1>
|
---|