[6370fa6] | 1 | <sect2>
|
---|
| 2 | <title>Command explanations</title>
|
---|
| 3 |
|
---|
[6879255] | 4 | <para><userinput>patch -Np0 -i ../glibc-2.2.3-nss.diff</userinput>: This
|
---|
| 5 | patch is needed to fix a couple of nasty nis bugs in glibc which can
|
---|
| 6 | cause problems.</para>
|
---|
| 7 |
|
---|
[b822811] | 8 | <para><userinput>mknod -m 0666 /dev/null c 1 3:</userinput> Glibc needs a
|
---|
[1242889] | 9 | null device to compile properly. All other devices will be created in the
|
---|
[b822811] | 10 | next section.</para>
|
---|
[1242889] | 11 |
|
---|
[9960acd] | 12 | <para><userinput>touch /etc/ld.so.conf</userinput> One of the final steps
|
---|
| 13 | of the Glibc installation is running ldconfig to update the dynamic loader
|
---|
| 14 | cache. If this file doesn't exist, the installation will abort with an error
|
---|
| 15 | that it can't read the file, so we simply create an empty file (the empty file
|
---|
| 16 | will have Glibc default to using /lib and /usr/lib which is fine
|
---|
| 17 | right now).</para>
|
---|
[4c70684] | 18 |
|
---|
[b822811] | 19 | <para><userinput>sed s/"\$(PERL)"/"\/usr\/bin\/perl"/
|
---|
[671561b] | 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
|
---|
[b822811] | 26 | Glibc.</para>
|
---|
[671561b] | 27 |
|
---|
[b822811] | 28 | <para><userinput>mv tmp~ ../glibc-2.2.3/malloc/Makefile:</userinput> The file
|
---|
[671561b] | 29 | <filename>tmp~</filename> is now moved back to
|
---|
| 30 | <filename>../glibc-2.2.3/malloc/Makefile</filename>. We do this because
|
---|
| 31 | when using sed, we can't write straight back to this file so we need to
|
---|
[b822811] | 32 | use a temporary file in between.</para>
|
---|
[671561b] | 33 |
|
---|
[b822811] | 34 | <para><userinput>sed "s/root/0" ../glibc-2.2.3/login/Makefile >
|
---|
[671561b] | 35 | tmp~:</userinput> This sed command replaces all occurances of
|
---|
| 36 | <filename>root</filename> in
|
---|
| 37 | <filename>../glibc-2.2.3/login/Makefile</filename> with 0. This is
|
---|
| 38 | because as we don't have glibc on the LFS system yet, usernames can't
|
---|
| 39 | be resolved to their user id's. Therefore, we replace the username
|
---|
[b822811] | 40 | root with the id 0. </para>
|
---|
[671561b] | 41 |
|
---|
[b822811] | 42 | <para><userinput>mv tmp~ ../glibc-2.2.3/login/Makefile:</userinput> As above,
|
---|
[671561b] | 43 | we are using a temporary file (<filename>tmp~</filename>) to store the
|
---|
[b822811] | 44 | edited Makefile and then copying it back over the original.</para>
|
---|
[671561b] | 45 |
|
---|
[b822811] | 46 | <para><userinput>--enable-add-ons:</userinput> This enables the add-on that
|
---|
| 47 | we install with Glibc: linuxthreads</para>
|
---|
[6370fa6] | 48 |
|
---|
[b822811] | 49 | <para><userinput>sed s/"cross-compiling = yes"/"cross-compiling = no"/
|
---|
[671561b] | 50 | config.make > config.make~:</userinput> This time, we're replacing
|
---|
| 51 | <filename>cross-compiling = yes</filename> with
|
---|
| 52 | <filename>cross-compiling = no</filename>. We do this because we are
|
---|
| 53 | only building for our own system. Cross-compiling is used, for
|
---|
| 54 | instance, to build a package for an Apple Power PC on an Intel system.
|
---|
| 55 | The reason Glibc thinks we're cross-compiling is that it can't compile a
|
---|
[633b1d1] | 56 | test program to determine this, so it automatically defaults to a
|
---|
[671561b] | 57 | cross-compiler. The reason for the failed program is because Glibc
|
---|
[b822811] | 58 | hasn't been installed yet.</para>
|
---|
[671561b] | 59 |
|
---|
[b822811] | 60 | <para><userinput>mv config.make~ config.make:</userinput> Again, we are moving
|
---|
| 61 | the temporary file over the original.</para>
|
---|
[671561b] | 62 |
|
---|
[6370fa6] | 63 | </sect2>
|
---|
| 64 |
|
---|