glibc-exp.xml 2.8 KB

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