glibc-inst.xml 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
  2. <sect2>
  3. <title>Glibc installation</title>
  4. <para>The Glibc build system is very well self-contained and will install
  5. perfectly, even though our compiler specs file and linker scripts are still
  6. pointing at <filename>/stage1</filename>. We cannot adjust the specs and
  7. ldscripts before the Glibc install, because the Glibc autoconf tests would then
  8. give bogus results and thus defeat our goal of achieving a clean build.</para>
  9. <para>Before starting to build Glibc, remember to unpack the Glibc-linuxthreads
  10. again inside the <filename>glibc-&glibc-version;</filename> directory, and to
  11. unset any environment variables that override the default optimization
  12. flags.</para>
  13. <para>Then apply the same patch we used previously:</para>
  14. <para><screen><userinput>patch -Np1 -i ../glibc-2.3.2-sscanf-1.patch
  15. </userinput></screen></para>
  16. <para>The documentation that comes with Glibc recommends to build the package
  17. not in the source directory but in a separate, dedicated directory:</para>
  18. <para><screen><userinput>mkdir ../glibc-build
  19. cd ../glibc-build</userinput></screen></para>
  20. <para>Now prepare Glibc for compilation:</para>
  21. <para><screen><userinput>../glibc-&glibc-version;/configure --prefix=/usr \
  22. &nbsp;&nbsp;&nbsp;&nbsp;--disable-profile --enable-add-ons \
  23. &nbsp;&nbsp;&nbsp;&nbsp;--libexecdir=/usr/bin --with-headers=/usr/include</userinput></screen></para>
  24. <para>The meaning of the configure options:</para>
  25. <itemizedlist>
  26. <listitem><para><userinput>--disable-profile</userinput>: This disables the
  27. building of the libraries with profiling information. Omit this option if you
  28. plan to do profiling.</para></listitem>
  29. <listitem><para><userinput>--enable-add-ons</userinput>: This enables any
  30. add-ons that we installed with Glibc, in our case Linuxthreads.</para></listitem>
  31. <listitem><para><userinput>--libexecdir=/usr/bin</userinput>: This will
  32. cause the <filename>pt_chown</filename> program to be installed in the
  33. <filename>/usr/bin</filename> directory.</para></listitem>
  34. <listitem><para><userinput>--with-headers=/usr/include</userinput>: This
  35. ensures that the kernel headers in <filename>/usr/include</filename> are used
  36. for this build. If you don't pass this switch then the headers from
  37. <filename>/stage1/include</filename> are used which of course is not ideal
  38. (although they should be identical). Using the switch has the advantage
  39. that you will be informed immediately should you have forgotten to install the
  40. kernel headers into <filename>/usr/include</filename>.</para></listitem>
  41. </itemizedlist>
  42. <para>Compile the package:</para>
  43. <para><screen><userinput>make</userinput></screen></para>
  44. <para>Test the results:</para>
  45. <para><screen><userinput>make check</userinput></screen></para>
  46. <para>And install the package:</para>
  47. <para><screen><userinput>make install</userinput></screen></para>
  48. <para>The locales that can make your system respond in a different language
  49. weren't installed by the above command. Do it with this:</para>
  50. <para><screen><userinput>make localedata/install-locales</userinput></screen></para>
  51. <para>An alternative to running the previous command is to install only those
  52. locales which you need or want. This can be achieved using the
  53. <userinput>localedef</userinput> command. Information on this can be found in
  54. the <filename>INSTALL</filename> file in the
  55. <filename>glibc-&glibc-version;</filename> tree.</para>
  56. <para>Finally, build the linuxthreads man pages:</para>
  57. <para><screen><userinput>make -C ../glibc-2.3.2/linuxthreads/man</userinput></screen></para>
  58. <para>And install these pages:</para>
  59. <para><screen><userinput>make -C ../glibc-2.3.2/linuxthreads/man install</userinput></screen></para>
  60. </sect2>