#317 mingw build fails due to Makefile INCLUDES


I was unable to get the MinGW runtime to cross-compile
on my Linux system. The problem was the INCLUDES
variables in the various makefiles. The makefiles all
have this definition (or a similar one) for INCLUDES:

INCLUDES = -I$(srcdir)/include
-I$(srcdir)/../w32api/include \ -I$(srcdir)/../include \ -nostdinc -nostdinc++ \ -iwithprefixbefore include

This definition assumes that the w32api includes are
all in a directory called ../w32api. I did not have
w32api here so it didn't work. It seems that it should
instead let gcc find these files in the default system
include directories. (For my cross environment, those
defaults are in /usr/i386-mingw32/include) Those files
that are included in mingw can override those in the
system directories by using -I directives.

I solved the problem for my purposes by changing the
include to the following:

INCLUDES = -I. -Iinclude

This points to the include directory inside the mingw
tree and lets gcc find the rest in standard locations.

I'm not certain that this solution will work for
everyone but it did solve my problems and I've included
a patch.

Another possibility would be to add a --with-win32api
argument to the configure script for pointing to a
w32api tree in a nonstandard location.


  • Earnie Boyd

    Earnie Boyd - 2003-03-13

    Logged In: YES

    Your solution isn't good enough. See what you can do to
    incorporate a --with-installed-w32api option into the configury.

    Your addition of ALL_CFLAGS for the gcrt[012].o targets
    should have been a modification of CFLAGS since CFLAGS is
    added to ALL_CFLAGS.


  • Earnie Boyd

    Earnie Boyd - 2003-03-13
    • status: open --> pending
  • Jeff Bonggren

    Jeff Bonggren - 2003-03-23
    • status: pending --> open
  • Jeff Bonggren

    Jeff Bonggren - 2003-03-23

    Logged In: YES

    I have a new patch that uses --with-w32api argument in the
    autoconf script.

    Let me know if there are any problems with this one.

  • Earnie Boyd

    Earnie Boyd - 2003-05-06
    • status: open --> closed-fixed
  • Earnie Boyd

    Earnie Boyd - 2003-05-06

    Logged In: YES

    I created my own fixes for this. I've given you credit for
    some of the work. I don't like the --with-w32api as it is
    using a feature for something other than its intended use.
    I may eventually use it. I'm looking for something
    different that I may add later.

    I used a W32API_INCLUDE variable whose default is set in
    configure.in. The variable can be overridden during the
    invocation of make via ``make


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks