[U-Boot-Users] [PATCH] cygwin build fixes
Lars Munch
lars at segv.dk
Mon Jul 26 13:43:16 CEST 2004
On Mon, Jul 26, 2004 at 01:07:04PM +0300, Yuli Barcohen wrote:
> >>>>> Lars Munch writes:
>
> Lars> The attached patch fixes cygwin builds. inttypes.h has been
> Lars> included in cygwin for quite some time now, so we do not need
> Lars> all the __WIN32__ ifdef's.
>
> Yuli> First of all, Cygwin is a Linux-like environment and not WIN32
> Yuli> so there is no need to #define __WIN32__ in the Makefile.
>
> Lars> That is true, but on older cygwin systems that define was
> Lars> needed in order to build the tools. To me it looks like
> Lars> __WIN32__ should have been named __CYGWIN__ in the first
> Lars> place, since all the "#ifdef __WIN32__" in the tools directory
> Lars> are cygwin related and not VC++ nor mingw related.
>
> Probably you're right. I don't know the history of this #define but
> according to GCC documentation, "All names which begin with two
> underscores, or an underscore and a capital letter, are reserved for the
> compiler and library to use as they wish." So __WIN32__ should not be
> defined for the tools, which are just applications, if it's not
> pre-defined by the compiler. But #define is not the only problem. When I
> worked around the #define, mkimage was built with incorrect endianness,
> so I had to investigate the problem and found the includes order issue,
> which is fixed by the patch.
Ok.
> Lars> Maybe we should just remove all the "#ifdef __WIN32__" from
> Lars> the tools directory since they are not needed any more for
> Lars> cygwin builds and has nothing to do VC++ nor mingw?
>
> I don't know if anybody needs them. There is Makefile.win32 in the tools
> directory so maybe somebody builds the tools on Win32 platform, though I
> suspect that nobody does. Maybe Wolfgang can answer your question...
I also suspect that nobody uses Makefile.win32 to build a "native
windows" mkimage.exe since mkimage uses "mmap" and that function is not
available on windows (on native windows you would use "CreateFileMapping"
instead).
I'll make a new patch which completely removes __WIN32__ from the tools
directory.
-- Lars Munch
More information about the U-Boot
mailing list