[coreboot] mingw build problem with seabios/tools/kconfig

Kevin O'Connor kevin at koconnor.net
Mon Mar 14 04:30:49 CET 2011


On Sun, Mar 13, 2011 at 09:55:55PM -0500, Scott Duplichan wrote:
> Kevin O'Connor wrote:
> ]What about making a file "mingw_fixups.h" and changing the HOSTCFLAGS
> ]to add "-include mingw_fixups.h".  The header can then do something
> ]like:
> ]
> ]#define uname(arg1) memset(arg1, 0, sizeof(*arg1))
> ]#define mkdir(arg1,arg2) mkdir(arg1)
> I bypassed the libregex problem for the moment and ran with the above
> change to see what other problems remain. A seabios/tools/kconfig/confdata.c
> call to rename(newname, dirname) fails. It appears the destination file must
> not exist for the win32 version of this function to succeed.

Can you fix this up using the same "mingw_fixups.h" trick?  That is,
something like:

static inline void myrename() { ...}

#define rename(...) myrename(...)

If you're having a conflict with a system header, you should be able
to include the header in mingw_fixups prior to the #define.

>Here is how the
> how the problem was overcome for coreboot:
> http://tracker.coreboot.org/trac/coreboot/changeset/4952
> When I add the UNLINK_IF_NECESSARY part of this change, the rename succeeds.
> Could seabios adopt this change?

It's possible, but I'd prefer to keep the source code close to the
Linux version - it makes merges later on easier.

-Kevin




More information about the coreboot mailing list