Subject: Re: Interix support (missing function utimes())
To: Todd Vierling <tv@duh.org>
From: James Chacon <jmc@NetBSD.org>
List: tech-toolchain
Date: 01/18/2005 17:04:44
On Tue, Jan 18, 2005 at 05:56:59PM -0500, Todd Vierling wrote:
> On Tue, 18 Jan 2005, Jesse Off wrote:
> 
> > I've been trying to cross build NetBSD-current using Interix (Windows Services
> > for UNIX).  Its important to some of our embedded customers to be able to work
> > in Windows since there is a lot of good EDA software that only runs on Windows
> > (IDE's for FPGA programming, PCB/schematic capture, etc.) I've run into a few
> > problems so far:
> >
> > * cc did not work for bootstrapping nbmake.. had to use HOST_CC="gcc"
> 
> This can be documented.  It's pretty well known that Interix "cc" (which is
> a wrapper around Visual C++) is just plain borken.  And, adding to that:
> 
> > * many missing declarations unless #define _ALL_SOURCE, had to add both
> > "HOST_CPPFLAGS=-D_ALL_SOURCE" and "CPPFLAGS=-D_ALL_SOURCE" since HOST_CPPFLAGS
> > seemed to be used only on the nbmake build
> 
> HOST_CC="gcc -D_ALL_SOURCE" should fix that globally.
> 
> > * missing zlib..  installed pkg from Interopsystems, but installed it in
> > /usr/local/[include,lib] so just cp'ed to /usr/include
> 
> HOST_CPPFLAGS="-I/usr/local/include"
> HOST_LDFLAGS="-I/usr/local/lib"

Actually should be -L there..Anyways, we should finally fix this and include
enough zlib in libnbcompat.a so this isn't a requirement anymore.

James


> will fix that without copying.
> 
> > * missing sys/mtio.h header for tools/compat..  removed from configure and all
> > was fine.
> 
> Well, pax won't work without it currently.  The mtio.h fixes in pkgsrc's
> copy of pax could be brought back to src/bin/pax.
> 
> > * linking tools/binstall failure.   There is no utimes or futimes on interix.
> > (Its been officially deprecated by Microsoft for utime())
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnucmg/html/UCMGch08.asp
> 
> Of course, utime() is less functional, but yep, I know that one.
> tools/compat is replicated in pkgsrc as "libnbcompat", and there's a
> utimes() replacement there; this could probably be brought back to
> src/tools/compat easily.
> 
> This would be worth putting into a PR; failing that, I'll look into
> documentation and fixes above when I can get a chance.
> 
> -- 
> -- Todd Vierling <tv@duh.org> <tv@pobox.com>
> 
>