glibc-exp.xml 3.1 KB

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