You need to restart your system back into the normal Linux system to compile the gcc compilers.
The GCC Installation notes recommend a separate directory for the object files. This means you have a directory where the gcc sources reside in and a different directory where compiled files are being created. Say you unpacked the gcc archive in /usr/src/gcc-2.95.2 , you could make a directory called /usr/src/gcc-install
../gcc-2.95.2/configure --prefix=/usr
--enable-shared
make bootstrap
$LFS/root/test.c
containing the following
// Begin test.c #include <stdio.h> int main() { printf("Hello World!\n"); return 0; } // End test.c
$LFS/root/test2.c
containing the following:
// Begin test2.c #include <iostream.h> int main() { cout << "Hello World!" << endl; return 0; } // End test2.c
/usr/src/gcc-2.95.2
to the usr/src/gcc-2.95.2
directory that contains the gcc source files.make install
test.c
by running gcc test.c -o testest2.c
by running g++ test2.c -o test2/usr/src/gcc-2.95.2
symlink
configure --prefix=/usr/gcc2723 --enable-shared
configure --host=<cpu>-linux-gnu --prefix=/usr/gcc2723
--enable-shared
Enter the right value for <cpu>. If you have a Pentium, enter i586. If you have a PII or higher, enter i686. If you don't have an Intel based platform than you have to figure out yourself what to enter since the only experience I have are with Intel based platforms (sorry, but I just don't have the money to buy myself an alpha, sparc or whatever system ;)
make LANGUAGES=c make stage1 (ignore errors about files not found) make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2" make stage2 make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2" make compare
make install CC="stage2/xgcc -Bstage2/" CFLAGS="-g
-O2"