gcc-local-inst.sgml 1.8 KB

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