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">
8 <sect1 id="ch-tools-generalinstructions"
9 xreflabel="General Compilation Instructions">
10 <?dbhtml filename="generalinstructions.html"?>
12 <title>General Compilation Instructions</title>
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
28 <para>Here are some things you should know about building each package:</para>
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
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>
54 <para>Check one last time that the <envar>LFS</envar> environment variable
55 is set up properly:</para>
57 <screen role="nodump"><userinput>echo $LFS</userinput></screen>
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
66 <para>Finally, two important items must be emphasized:</para>
70 <para>The build instructions assume that the <xref
71 linkend='ch-partitioning-hostreqs'/>, including symbolic links, have
72 been set properly:</para>
74 <itemizedlist role='important'>
76 <listitem override='bullet'><para><command>bash</command> is the shell
77 in use.</para></listitem>
79 <listitem override='bullet'><para><command>sh</command> is a symbolic
80 link to <command>bash</command>.</para></listitem>
82 <listitem override='bullet'><para><command>/usr/bin/awk</command> is a
83 symbolic link to <command>gawk</command>.</para></listitem>
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>
93 <para>Here is a synopsis of the build process.</para>
95 <orderedlist numeration="arabic" spacing="compact">
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>
104 <para>Change to the <filename class="directory">/mnt/lfs/sources/</filename> directory.</para>
106 <listitem id='buildinstr' xreflabel='Package build instructions'>
107 <para>For each package:</para>
108 <orderedlist numeration="loweralpha" spacing="compact">
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>
117 source code tree somewhere else can destroy
118 timestamps in the source tree, and cause the build to fail.</para>
121 <para>Change to the directory created when the package was
125 <para>Follow the instructions for building the package.</para>
128 <para>Change back to the sources directory when the build is complete.</para>
131 <para>Delete the extracted source directory unless instructed otherwise.</para>