Help configuring gcc
David Daney
ddaney@avtrex.com
Wed Jun 20 17:34:00 GMT 2007
Luke Dickens wrote:
> Hi,
>
> I apologise in advance if this is the wrong place to ask this question,
> but I couldn't find any suitable forums.
>
This is the place.
> I am trying to fathom the installation procedure for gcc-core and
> gcc-g++ on Windows XP and I think I must be missing something. So far I
> have done the following:
>
> - I have installed a programme called MSyS onto my machine. Which seems
> to give me a posix style command line that I can run. I have installed
> this in C:Program Files\msys.
> - I then installed a programme called MingW32, which I believe to be a
> c-compiler in binary form. Now as I understand things gcc is itself a
> c-compiler, so I don't really understand why this step is needed. If
> someone can compile a c-compiler elsewhere (MingW32) then why can't they
> compile gcc in the same way, or am I missing something. Anyway, for
> reasons I can no longer remember I installed MingW32 in a subdirectory
> of the msys folder, i.e. C:Program Files\msys\1.0\mingw, I no longer
> know whether this was accidental or intentional.
> - I then downloaded the gcc-core.tar.bz2 and gcc-g++.tar.bz2 and copied
> these into my home directory under msys, so C:Program
> Files\msys\1.0\home\Luke in windows parlance, but this appears as
> /home/Luke or simply ~ in msys command line.
> - I unzipped them both into a gcc-4.2.0 folder, and then created a
> subdirectory srcdir and moved all the unzipped files and folders into
> this directory. Then made another directory objdir. So my home directory
> now looks like this
>
> /home/Luke/gcc-4.2.0
> |---------- srcdir
> | |-------- ...
> | \-------- <all the other
> files/folders from the tarballs>
> |
> \---------- objdir
>
>
> - Then I try to run configure and I get the following error:
> Luke@GODEL ~/gcc-4.2.0/srcdir
> $ cd ../objdir/
>
> Luke@GODEL ~/gcc-4.2.0/objdir
> $ ../srcdir/configure loading cache ./config.cache
> checking host system type... i686-pc-mingw32
> checking target system type... i686-pc-mingw32
> checking build system type... i686-pc-mingw32
> checking for a BSD compatible install... /bin/install -c
> checking whether ln works... yes
> checking whether ln -s works... no
> checking for gcc... no
> checking for cc... no
> configure: error: no acceptable cc found in $PATH
>
> Now I understand what this is telling me. It is telling me that there is
> no binary file called gcc or cc which can be used, because the path
> doesn't point towards any folder that contains such a binary. But the
> reason I am doing all this is to get a gcc compiler. It is all very
> confusing and I would greatly appreciate any help/advice on the issue. I
> have looked for a suitable gcc file under mingw32 but this didn't seem
> to come with one.
>
I am not a mingw expert, but what you are doing looks reasonable.
GCC is written in the C programming language. In order to build it you
need a C compiler. It presents a chicken-and-egg problem if you don't
already have a suitable compiler.
I would search for pre-built GCC images for your system, and install one
of those. After you have a working GCC, you can build new versions with
that.
David Daney.
More information about the Gcc-help
mailing list