This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Configuring and Compiling GCC for Windows
- From: Oscar Fuentes <ofv at wanadoo dot es>
- To: Mark Butcher <M_J_BUTCHER at compuserve dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: 22 May 2002 01:54:42 +0200
- Subject: Re: Configuring and Compiling GCC for Windows
- References: <200205211846_MC3-FEFD-9D6C@compuserve.com>
- Reply-to: gcc-help at gcc dot gnu dot org
Mark Butcher <M_J_BUTCHER@compuserve.com> writes:
> Hi All
>
> I haven't given up yet, although I don't seem to be getting much 'moral'
> support as of yet..
>
> Here's the latest situation, in the hope that there is someone out there a
> heart to share a little expertise with a struggling beginner.
>
> 1. Have left NT and gone back to Windows 98 because more was working there.
Bad idea.
> 2. Originally the configure was failing after typing in the following
> command in cygwin bash shell
>
> c:/usr/local/src/gcc-3.0.4/configure
[snipped configure output]
>From a previous post of yours I know you want to create several cross
compilers. Well, keep in mind that the 'configure' scripts and the
'Makefiles' it outputs are created for *nix environments. They *must*
work in *nix environments or either a bug report to the GCC
maintainers should filled. Cygwin tries to emulate *nix environment
working inside Windows, that is, it adds another possible break-point
to the chain. If you really want to do serious cross-compiling work
with GCC, go for Linux, everything should work there. I'm not saying
that it is impossible with Windows, but certainly it will be easier
with Linux.
> I am presently assuming that the first message about the configuration not
> being supported in some directories is not important (or is it ?) because I
> don't know how I could otherwise influence it.
No, it is nor important, unless you want the stuff it contains (C and
C++ will work ok without it).
> 3. I did make a small breakthrough by typing in the command differently
> (obviously c: is not good ). At last some progress to show for an evenings
> work !!
>
> /cygdrive/c/usr/local/src/gcc-3.0.4/configure
See, do you realize that in order to obtain something with Cygwin you
must work as if it were a *nix box? This is another reason for going
to the true *nix.
> *** This configuration is not supported in the following subdirectories:
> target-libffi target-boehm-gc target-zlib target-libjava
> (Any other directories should still work fine.)
> ....
> ....
> .... (all fine 'till here now)
> checking whether build environment is sane... yes
> checking whether make sets ${MAKE}... eval1: syntax error: unterminated
> quoted string
> configure in /cygdrive/c/usr/local/src/gcc-objdir/zlib failed, exiting.
>
> Still the first note (warning or fatal error ?) but the make files are
> successfully created. Still the problem with a syntax error but don't know
> where to look at the moment.
Are you trying to build from a directory with a path that contains
embedded blank spaces, by chance?
> Still hoping for that elusive tip..
GCC 3.x with default settings builds ok with Cygwin. I'm not so sure
about building crosscompilers. Once I tried and it won't work.
I guess your problems are:
1. Obtaining and configuring the necessary software. The MinGW project
contains MSYS, wich is a kind of Cygwin created specifically for
doing what you want. It comes with everything you need for building
GCC. As in the case of Cygwin, it's possible that it doesn't work
for creating cross-compilers. You will only need the MSYS package
and the MinGW 1.1 package. Unpack MinGW first, then install MSYS
and pay attention at the final question the installer asks about
where MinGW is unpacked. Answer with a pathname with forward
slashes, that is, if you unpacked MinGW on c:\mingw answer c:/mingw
You can obtain the packages at
http://sourceforge.net/project/showfiles.php?group_id=2435
then launch a MSYS terminal and write
gcc -v
for checking that GCC is there. Then do
configure --enable-languages=c,c++ --prefix=c:/mingw
pay attention to the path you specify for --prefix. It must be the
same where you unpacked MinGW. Now 'configure' should work. Then do
a 'make bootstrap' and then 'make install'. At last check that the
new gcc is there doing 'gcc -v'
2. Newbies need help. Is hard to obtain help when asking people about
how to do things the wrong way. I guess most people here thinks you
shouldn't do what you want in Windows. Well, MinGW is about working
with GCC in Windows. There you will enjoy a more receptive
environment. Since some time ago, almost no questions remain
unanswered. Just be sure of doing your homework before asking and
do not disregard the advices without a good reason for doing so ;-)
Go to www.mingw.org and subscribe to the msys and mingw-users
mailing lists.
3. Finally, you need to understand what you are doing. You need to
know what 'sed', 'cat' and a configure script are, and a bunch of
things more. If you do not learn it, hardly you can fix even the
most minor problem yourself. Take a good book about Unix/Linux and
read it. There are inmense resources on the web about this too.
HTH
--
Oscar