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-generalinstructions"
|
---|
9 | xreflabel="General Compilation Instructions">
|
---|
10 | <?dbhtml filename="generalinstructions.html"?>
|
---|
11 |
|
---|
12 | <title>General Compilation Instructions</title>
|
---|
13 |
|
---|
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 |
|
---|
28 | <para>Here are some things you should know about building each package:</para>
|
---|
29 |
|
---|
30 | <itemizedlist>
|
---|
31 |
|
---|
32 | <listitem>
|
---|
33 | <para>Several packages are patched before compilation, but only when
|
---|
34 | the patch is needed to circumvent a problem. A patch is often needed in
|
---|
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.
|
---|
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
|
---|
40 | not worry about these warnings; the patch was still successfully
|
---|
41 | applied.</para>
|
---|
42 | </listitem>
|
---|
43 |
|
---|
44 | <listitem>
|
---|
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
|
---|
48 | deprecated, but not invalid, use of the C or C++ syntax. C standards change
|
---|
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>
|
---|
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 |
|
---|
66 | <para>Finally, two important items must be emphasized:</para>
|
---|
67 |
|
---|
68 | <important>
|
---|
69 |
|
---|
70 | <para>The build instructions assume that the <xref
|
---|
71 | linkend='ch-partitioning-hostreqs'/>, including symbolic links, have
|
---|
72 | been set properly:</para>
|
---|
73 |
|
---|
74 | <itemizedlist role='important'>
|
---|
75 |
|
---|
76 | <listitem override='bullet'><para><command>bash</command> is the shell
|
---|
77 | in use.</para></listitem>
|
---|
78 |
|
---|
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
|
---|
86 | symbolic link to <command>bison</command>, or to a small script that
|
---|
87 | executes bison.</para></listitem>
|
---|
88 |
|
---|
89 | </itemizedlist>
|
---|
90 | </important>
|
---|
91 |
|
---|
92 | <important>
|
---|
93 | <para>Here is a synopsis of the build process.</para>
|
---|
94 |
|
---|
95 | <orderedlist numeration="arabic" spacing="compact">
|
---|
96 | <listitem>
|
---|
97 | <para>Place all the sources and patches in a directory that will be
|
---|
98 | accessible from the chroot environment, such as
|
---|
99 | <filename class="directory">/mnt/lfs/sources/</filename>.<!-- Do
|
---|
100 | <emphasis>not</emphasis> put sources in
|
---|
101 | <filename class="directory">/mnt/lfs/tools/</filename>. --></para>
|
---|
102 | </listitem>
|
---|
103 | <listitem>
|
---|
104 | <para>Change to the <filename class="directory">/mnt/lfs/sources/</filename> directory.</para>
|
---|
105 | </listitem>
|
---|
106 | <listitem id='buildinstr' xreflabel='Package build instructions'>
|
---|
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
|
---|
111 | to be built. In <xref linkend="chapter-cross-tools"/> and
|
---|
112 | <xref linkend="chapter-temporary-tools"/>, ensure you are
|
---|
113 | the <emphasis>lfs</emphasis> user when extracting the package.</para>
|
---|
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
|
---|
117 | source code tree somewhere else can destroy links and
|
---|
118 | timestamps in the source tree, and cause the build to fail.</para>
|
---|
119 | </listitem>
|
---|
120 | <listitem>
|
---|
121 | <para>Change to the directory created when the package was
|
---|
122 | extracted.</para>
|
---|
123 | </listitem>
|
---|
124 | <listitem>
|
---|
125 | <para>Follow the instructions for building the package.</para>
|
---|
126 | </listitem>
|
---|
127 | <listitem>
|
---|
128 | <para>Change back to the sources directory when the build is complete.</para>
|
---|
129 | </listitem>
|
---|
130 | <listitem>
|
---|
131 | <para>Delete the extracted source directory unless instructed otherwise.</para>
|
---|
132 | </listitem>
|
---|
133 | </orderedlist>
|
---|
134 | </listitem>
|
---|
135 | </orderedlist>
|
---|
136 | </important>
|
---|
137 | </listitem>
|
---|
138 |
|
---|
139 | </itemizedlist>
|
---|
140 |
|
---|
141 | </sect1>
|
---|