Re: MinGW build instructions

Christopher Faylor
2005-05-11T16:12:02Z

On Wed, May 11, 2005 at 12:21:16AM -0700, Mark Mitchell wrote:
>Eli Zaretskii wrote:
>>As an aside, what little experience I have in porting Unix programs to
>>MinGW tells me that setting up an environment to build a package is
>>not a trivial job. There are issues with what shell to use and how to
>>set it up, what ports of auxiliary tools (Coreutils, Grep, Awk, etc.)
>>to use and how to set them up, what non-default libraries to install
>>and link against (the MinGW libraries such as libiberty, Libgw32c), etc.
>>
>>So perhaps, if we are going to have an alive MinGW port, it is a good
>>idea to have a README.MinGW file in the distro that would describe how
>>to build such a port of GDB. A description of the setup Mark uses to
>>work on the port would be a good starting point.
>
>I'd be happy to write it up -- but what I do is simple: I cheat. I use
>cross compilers from i686-pc-linux-gnu to i686-ming32. If it would be
>useful for me to show how I configure and build GDB like that, I'm happy
>to write that up; just let me know.

Some people use the cygwin-fork (grr...) MSYS to do mingw development.
It should contain every package that you need to build gdb, I think.
And, I am mentioning this through gritted teeth in the interests of
full disclosure.

At least one of the mingw developers just uses cygwin to do mingw
development, which, of course, seems to be to be the ultimate solution
if you want to work on windows. AFAIK, cygwin's libraries like autoconf
and gettext seem to be updated more frequently than MSYS.

You don't have to install 700MB of cygwin to get things working. You
should be able to get away with just installing the bits that you need +
the mingw compiler. Or, it is possible that a i686-pc-mingw32-gcc
wrapper like:

#!/bin/sh
exec gcc -mno-cygwin "$@"

may "just work" with the cygwin version of gcc. The -mno-cygwin option
to gcc actually uses the mingw headers and libraries. Unfortunately,
there is a problem with cygwin-bleedover for libraries, though, so
you have to be careful not to specify any libraries on the command
line which exist on cygwin but not in mingw. This is something that
I keep meaning to fix in gcc/binutils...

cgf