Configuring and Compiling GCC for Windows

CM cmml@btinternet.com
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
itself.

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.

CM

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

-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] 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
utilities
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
building
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
compiler
so that it can work and I have been using the traditional technique of
adding a path in my autoexec.bat file like this

SET PATH=C:\MINGW\BIN

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
find
it)


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

PATH='/usr/local/bin:/usr/bin:/bin:/cygdrive/c/WINDOWS:/cygdrive/c/WINDO
WS:
/cygdrive/c/WINDOWS/COMMAND:/cygdrive/c/MINGW/BIN'


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

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
it
runs, giving the following details:

MAKE FILE CONTENTS
all:
         @echo 'ac_maketemp="$(MAKE)"'

EXECUTION RESPONSE
ac_maketemp=\c:/MINGW/BIN/MAKE.EXE"




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

\c:/MINGW/BIN/MAKE.EXE"

which is a bit of a DOS / Unix path convention mix along with a
terminating
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
as
is instructed in the configuration details but, while I seem to be able
to
achieve this, it can not be the correct solution since there are then
other
error messages saying that the compiler has been found but doesn't work.
I
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
beginner
- I don't really have a clue about working in a Unix environment and
would
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
am
getting is either forget what I want to do because no one understands
why
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
a
bit like not being allowed to visit the Pyramids until I have gone away
and
learned fluent Egyption. Perhaps I should not allow my daughter to
install
a game software on the PC until she has understood the machine code of
the
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.
I
will be eternally grateful and will attempt (once I am experienced with
the
compiler - which is my goal) to contribute something back to the GNU
community.

Many thanks in anticipation


Mark Butcher

Switzerland




More information about the Gcc-help mailing list