making up for cvs export not creating empy dirs
[linux_from_scratch.git] / BOOK / chapter05 / gcc-inst.xml
blobca72446377dccd34c1c0c38bfc2f6828f1b1a6a0
1 <sect2>
2 <title>Installation of GCC</title>
4 <para>This package is known to behave badly when you have changed its default
5 optimization flags (including the -march and -mcpu options). GCC is best
6 left alone, so we recommend you unsetting CFLAGS, CXXFLAGS and other
7 such variables/settings that would change the default optimization that
8 it comes with.</para>
10 <para>Install GCC by running the following commands:</para>
12 <para><screen><userinput>patch -Np1 -i ../gcc-&gcc-patch-version;.patch &amp;&amp;
13 mkdir ../gcc-build &amp;&amp;
14 cd ../gcc-build &amp;&amp;
15 ../gcc-&gcc-version;/configure --prefix=/usr --enable-languages=c,c++ \
16 &nbsp;&nbsp;&nbsp;--disable-nls --disable-shared --enable-threads=posix &amp;&amp;
17 make BOOT_LDFLAGS=-static bootstrap &amp;&amp;
18 make prefix=$LFS/usr install &amp;&amp;
19 cd $LFS/lib &amp;&amp;
20 ln -sf ../usr/bin/cpp &amp;&amp;
21 cd $LFS/usr/lib &amp;&amp;
22 ln -sf ../bin/cpp &amp;&amp;
23 cd $LFS/usr/bin &amp;&amp;
24 ln -sf gcc cc &amp;&amp;
25 rmdir $LFS/usr/*-gnu/include &amp;&amp;
26 rmdir $LFS/usr/*-gnu</userinput></screen></para>
28 </sect2>