I am trying to install GCC from source. I am following the instructions on the wiki at https://gcc.gnu.org/wiki/InstallingGCC and also on this question on SO. I am running into issues on the configure step when running:
I get the following output and error:
checking whether ln works... yes checking whether ln -s works... yes checking for a sed that does not truncate output... /bin/sed checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking for libatomic support... yes checking for libcilkrts support... no checking for libitm support... yes checking for libsanitizer support... yes checking for libvtv support... yes checking for libmpx support... no checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in `/usr/bin/objdir': configure: error: no acceptable C compiler found in $PATH See `config.log' for more details.
I appears as if the error is because there is no C compiler installed. This confuses me because isn't installing a C compiler what installing GCC is supposed to do? All the solutions I can find for this error say that I need to install GCC, so how can I install GCC if I need GCC installed to do it?
I have updated my $PATH variable using
export PATH=$PATH:/usr/bin/gcc-4.6.2 but it didn't help. I have also looked at this similar question without success: https://unix.stackexchange.com/questions/310669/c-compiler-while-installing-gcc
Is there something I am missing? What else can I do to get GCC installed?
NOTE: I can't just use yum or apt-get to install it because I am using a custom distribution that does not have those type of installer software installed.