gcc-local-inst.sgml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <sect2>
  2. <title>Installation of GCC on the normal system if necessary</title>
  3. <para>
  4. In order to compile Glibc-2.1.3 later on you need to have gcc-2.95.2
  5. installed. Although any GCC version above 2.8 would do, 2.95.2 is the
  6. highly
  7. recommended version to use. egcs-2.91.x is also known to work. If you
  8. don't have gcc-2.95.x or egcs-2.91.x you need to install gcc-2.95.2 on
  9. your normal sytem before you can compile Glibc later in this chapter.
  10. </para>
  11. <para>
  12. To find out which compiler version your systems has, run the
  13. following command:
  14. </para>
  15. <blockquote><literallayout>
  16. <userinput>gcc --version</userinput>
  17. </literallayout></blockquote>
  18. <para>
  19. If you normal Linux system does not have gcc-2.95.x or egcs-2.91.x
  20. installed you need to install it now. We won't replace the current
  21. compiler on your system, but instead we will install gcc in a separate
  22. directory (/usr/local/gcc2952). This way no binaries or header files will be
  23. replaced.
  24. </para>
  25. <para>
  26. After you unpacked the gcc-2.95.2 archive don't enter the newly created
  27. gcc-2.95.2 directory but stay in the $LFS/usr/src directory. Install GCC by
  28. running the following commands:
  29. </para>
  30. <blockquote><literallayout>
  31. <userinput>mkdir $LFS/usr/src/gcc-build &amp;&amp;</userinput>
  32. <userinput>cd $LFS/usr/src/gcc-build &amp;&amp;</userinput>
  33. <userinput>../gcc-2.95.2/configure \</userinput>
  34. <userinput>&nbsp;&nbsp;&nbsp;--prefix=/usr/local/gcc2952 \</userinput>
  35. <userinput>&nbsp;&nbsp;&nbsp;--with-local-prefix=/usr/local/gcc2952
  36. \</userinput>
  37. <userinput>&nbsp;&nbsp;
  38. --with-gxx-include-dir=/usr/local/gcc2952/include/g++ \</userinput>
  39. <userinput>&nbsp;&nbsp;&nbsp;--enable-shared --enable-languages=c,c++
  40. &amp;&amp;</userinput>
  41. <userinput>make bootstrap &amp;&amp;</userinput>
  42. <userinput>make install</userinput>
  43. </literallayout></blockquote>
  44. </sect2>