Configuring and Compiling GCC for Windows

Sun May 26 04:30:00 GMT 2002

You can't build a native mingw compiler from source using the mingw
tool-chain itself AFAICT. You need to use the gcc supplied with cygwin
(use the setup.exe, it along with other tools you will need such as
binutils, is in the 'Devel' category). Use these, and remove the mingw
from your path. After you have a working gcc, you can use that to build
a cygwin to mingw cross compiler (cygwin and mingw are two entirely
different systems) which is what you are trying to do now. You can now
use this compiler to build a native win32 executables, much like the gcc
you are trying to use now, apart from the fact that it will understand
cygwin paths and mounts. The compiler used to build the mingw compiler
must understand cygwin paths, so must have been built using cygwin

I would suggest that you try to use cygwin native tools, but if the
dependency on cygwin1.dll really bothers you, then mingw or DJGPP are
your only options. DJGPP has a 3.x series compiler with it; I don't know
whether mingw has a binary of it yet.


PS: Why do you need 3.x so badly?

-----Original Message-----
From: [] On
Behalf Of Mark Butcher
Sent: 26 May 2002 00:34
To: gcc-help
Cc: John Love-Jensen
Subject: Re: Configuring and Compiling GCC for Windows

Hi All

I have been trying to build gcc for almost three weeks now. During this
time I have learned a lot about a number of things - shells, GNU
and others which are needed.

I believe that I understand why after this time I am still not past the
second step in the process (configuring, not yet actually to the
step). The problem I have is very probably a setup issue (don't know for
sure whether Windows or cygwin - but probably cygwin).

The issue is that I need to tell cygwin where to find the native
so that it can work and I have been using the traditional technique of
adding a path in my autoexec.bat file like this


When I do this I can type in gcc -v in the cygwin shell and the compiler
details are correctly displayed (without the path entry cygwin can not

I check the environment variables in the cygwin shell with the SET
and see the following entry:


The configuration fails with the message that there is a syntax error in
make file which has just been created and checked, with the following

checking whether make sets ${MAKE}... eval1: syntax error: unterminated
quoted string
configure in /cygdrive/c/objdir/zlib failed, exiting.

I run the make file in the gcc subdirectory, which is being tested and
runs, giving the following details:

         @echo 'ac_maketemp="$(MAKE)"'


So, somewhere along the line $(MAKE) has been substituted by 


which is a bit of a DOS / Unix path convention mix along with a
quote. Since this substitution is not valid, the configuration aborts.

In the meantime I have tested a number of possibilities to try to tell
cygwin where the compiler is, without setting the path, but as of yet
without any success. I have attempted to set the CC environment variable
is instructed in the configuration details but, while I seem to be able
achieve this, it can not be the correct solution since there are then
error messages saying that the compiler has been found but doesn't work.
know that it works because I can compile with it and the compiled
programmes run.

I know that I must be making some beginners mistake because I am a
- I don't really have a clue about working in a Unix environment and
probably have already given up long ago if it were not for some helpful
support along the way. Nevertheless the answer is probably simple to
experienced Unix gurus out there. The problem is that the main advice I
getting is either forget what I want to do because no one understands
on earth I should want to do it in the first place, or go away and learn
Unix and Linux inside out before attempting to continue. This is for me
bit like not being allowed to visit the Pyramids until I have gone away
learned fluent Egyption. Perhaps I should not allow my daughter to
a game software on the PC until she has understood the machine code of
operating sytem ?

So please someone - have a heart - and pass on the secret to a simple
Windows user of how set up what ever instruction or variable is missing.
will be eternally grateful and will attempt (once I am experienced with
compiler - which is my goal) to contribute something back to the GNU

Many thanks in anticipation

Mark Butcher


More information about the Gcc-help mailing list