added man-patch.xml file
[linux_from_scratch.git] / FAQ-OBSOLETE / dirty-sources.xml
blob5d3ab692049ad752c13b8e41679f4555b9f06e5a
1 <qandaentry id="dirty-sources">
2 <question><para>I didn't delete the source tree after my last attempt.
3 Do I need to?</para></question>
4 <answer><para>Yes. You should always delete the source tree after installing
5 and delete it and start over if anything fails.
6 </para>
7 <para>The only exception is the kernel.
8 Most people keep their kernel source so they don't have to reconfigure
9 it from scratch if they need to make a small change.
10 If a large change is needed, like changing processor type,
11 it may be necessary to restart with a fresh tree even with the kernel.
12 </para>
13 <para>Here's an example when everything works:
14 <screen>tar xvjf foo-0.0.tar.bz2
15 cd foo-0.0
16 ./configure --prefix=/usr
17 make
18 make install
19 <emphasis role="strong">cd ..
20 rm -rf foo-0.0</emphasis>
21 </screen>
22 And here's an example for if something (in this case configure) fails:
23 <screen>tar xvjf foo-0.0.tar.bz2
24 cd foo-0.0
25 ./configure --prefix=/usr
29 *** configure: error: foo requires libess 4.2 or greater
30 please install libess and rerun configure.
31 <emphasis role="strong">cd ..
32 rm -rf foo-0.0</emphasis>
33 tar xvjf libess-4.2.tar.bz2
34 cd libess-4.2
35 ./configure --prefix=/usr
36 make
37 make install
38 <emphasis role="strong">cd ..
39 rm -rf libess-4.2</emphasis>
40 tar xvjf foo-0.0.tar.bz2
41 cd foo-0.0
42 ./configure --prefix=/usr
43 make
44 make install
45 <emphasis role="strong">cd ..
46 rm -rf foo-0.0</emphasis>
47 </screen></para>
48 <para>Ed. Note: The name of the fictional libess above follows
49 libiberty (from glibc, AFAIK) and libofat.
50 The reason comes from the gcc flag, -l, for linking a library when compiling.
51 For instance,
52 <screen>gcc -o foo foo.c -lm
53 </screen>
54 would link the "m" (math) library with the executable foo.
55 So, for the libraries above, the command looks like:
56 <screen>gcc -o foo foo.c -liberty -lowfat -less
57 </screen></para>
58 <para>Bonus points if you caught the reference to
59 The Hitchhiker's Guide to the Galaxy, by Douglas Adams in the example.
60 </para></answer>
61 </qandaentry>