1 | <sect2>
|
---|
2 | <title>Command explanations</title>
|
---|
3 |
|
---|
4 | <para>
|
---|
5 | <userinput>mknod -m 0666 /dev/null c 1 3:</userinput> Glibc needs a
|
---|
6 | null device to compile properly. All other devices will be created in the
|
---|
7 | next section.
|
---|
8 | </para>
|
---|
9 |
|
---|
10 | <para>
|
---|
11 | <userinput>touch /etc/ld.so.conf</userinput> One of the final steps of
|
---|
12 | the Glibc installation is running ldconfig to update the dynamic loader
|
---|
13 | cache. If this file isn't present Glibc will abort with an error that it
|
---|
14 | can't read the file. So we create an empty file for it (the empty file
|
---|
15 | will have Glibc default to using /lib and /usr/lib which is fine right now).
|
---|
16 | </para>
|
---|
17 |
|
---|
18 | <para>
|
---|
19 | <userinput>sed s/"\$(PERL)"/"\/usr\/bin\/perl"/
|
---|
20 | ../glibc-2.2.3/malloc/Makefile > tmp~:</userinput> This sed command
|
---|
21 | searches through <filename>../glibc-2.2.3/malloc/Makefile</filename> and
|
---|
22 | converts all occurances of <filename>$(PERL)</filename> to
|
---|
23 | <filename>/usr/bin/perl</filename>. The output is then written to the
|
---|
24 | file <filename>tmp~</filename>. This is done because Glibc can't
|
---|
25 | autodetect perl since it's not installed yet at the time when we install
|
---|
26 | Glibc.
|
---|
27 | </para>
|
---|
28 |
|
---|
29 | <para>
|
---|
30 | <userinput>mv tmp~ ../glibc-2.2.3/malloc/Makefile:</userinput> The file
|
---|
31 | <filename>tmp~</filename> is now moved back to
|
---|
32 | <filename>../glibc-2.2.3/malloc/Makefile</filename>. We do this because
|
---|
33 | when using sed, we can't write straight back to this file so we need to
|
---|
34 | use a temporary file in between.
|
---|
35 | </para>
|
---|
36 |
|
---|
37 | <para>
|
---|
38 | <userinput>sed "s/root/0" ../glibc-2.2.3/login/Makefile >
|
---|
39 | tmp~:</userinput> This sed command replaces all occurances of
|
---|
40 | <filename>root</filename> in
|
---|
41 | <filename>../glibc-2.2.3/login/Makefile</filename> with 0. This is
|
---|
42 | because as we don't have glibc on the LFS system yet, usernames can't
|
---|
43 | be resolved to their user id's. Therefore, we replace the username
|
---|
44 | root with the id 0.
|
---|
45 | </para>
|
---|
46 |
|
---|
47 | <para>
|
---|
48 | <userinput>mv tmp~ ../glibc-2.2.3/login/Makefile:</userinput> As above,
|
---|
49 | we are using a temporary file (<filename>tmp~</filename>) to store the
|
---|
50 | edited Makefile and then copying it back over the original.
|
---|
51 | </para>
|
---|
52 |
|
---|
53 | <para>
|
---|
54 | <userinput>--enable-add-ons:</userinput> This enables the add-on that
|
---|
55 | we install with Glibc: linuxthreads
|
---|
56 | </para>
|
---|
57 |
|
---|
58 | <para>
|
---|
59 | <userinput>sed s/"cross-compiling = yes"/"cross-compiling = no"/
|
---|
60 | config.make > config.make~:</userinput> This time, we're replacing
|
---|
61 | <filename>cross-compiling = yes</filename> with
|
---|
62 | <filename>cross-compiling = no</filename>. We do this because we are
|
---|
63 | only building for our own system. Cross-compiling is used, for
|
---|
64 | instance, to build a package for an Apple Power PC on an Intel system.
|
---|
65 | The reason Glibc thinks we're cross-compiling is that it can't compile a
|
---|
66 | test program to determin this, so it automatically default to a
|
---|
67 | cross-compiler. The reason for the failed program is because Glibc
|
---|
68 | hasn't been installed yet.
|
---|
69 | </para>
|
---|
70 |
|
---|
71 | <para>
|
---|
72 | <userinput>mv config.make~ config.make:</userinput> Again, we are moving
|
---|
73 | the temporary file over the original.
|
---|
74 | </para>
|
---|
75 |
|
---|
76 | </sect2>
|
---|
77 |
|
---|