gcc-inst.xml 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. <sect2>
  2. <title>Installation of GCC</title>
  3. <para>This package requires its patch to be applied before you can
  4. install it. Make sure it's unpacked before running the installation
  5. commands.</para>
  6. <para>This package is known to behave badly when you have changed its
  7. default optimization flags (including the -march and -mcpu options). GCC is
  8. best left alone. Therefore, if you have defined any environment variables
  9. that override default optimizations, such as CFLAGS and CXXFLAGS, we
  10. recommend unsetting or modifying them when building GCC. You have
  11. been warned.</para>
  12. <para>Install GCC by running the following commands. These commands will
  13. build the C and C++ compilers, so you'll need to unpack both the gcc-core
  14. and gcc-g++ tarballs. Other compilers are available in the full gcc package;
  15. instructions for building them may be found at
  16. <ulink url="&blfs-root;view/cvs/general/gcc.html"/>.</para>
  17. <para><screen><userinput>patch -Np1 -i ../gcc-&gcc-patch-version;.patch &amp;&amp;
  18. mkdir ../gcc-build &amp;&amp;
  19. cd ../gcc-build &amp;&amp;
  20. ../gcc-&gcc-version;/configure --prefix=/usr --enable-shared \
  21. &nbsp;&nbsp;&nbsp;&nbsp;--enable-threads=posix --with-slibdir=/lib \
  22. &nbsp;&nbsp;&nbsp;&nbsp;--enable-__cxa_atexit --enable-clocale=gnu &amp;&amp;
  23. make bootstrap &amp;&amp;
  24. make install &amp;&amp;
  25. ln -s ../usr/bin/cpp /lib &amp;&amp;
  26. ln -s ../bin/cpp /usr/lib &amp;&amp;
  27. ln -s gcc /usr/bin/cc</userinput></screen></para>
  28. </sect2>