On Thu, Apr 03, 2008 at 08:26:23PM +0200, Wolfgang Denk wrote:
> In message <[EMAIL PROTECTED]> you wrote:
> >
> > I think this makes sense for code that we for example link from host's
> > standard libraries. But for code compiled from files from the U-Boot
> > tree (like lib_generic/md5.c), we shouldn't include host's header files.
> 
> But you, you should. Note that we are talking about host tools  here,
> i.  e.  stuff that is supposed to run in the host environment. Assume
> your're building for a big-endian, 32 bit Power system.  Assume  your
> host is a little-endian x86_64 system.
> 
> Even simple tungs like a printf() require that you include the correct
> host header files as you will link your host application against the
> host libraries, too.

That's because printf() is from the host's libraries.  lib_generic/md5.c
is not a host-provided library, so you don't want to use a host-provided
header.

> > > 2) Use relative file names (as suggested by Kumar) or similar methods
> > >    to make sure we pick up the md5.h header file from a local
> > >    directory instead from /usr/include.
> > > 3) Rename md5.h to make sure we use a pick up our own file instead of
> > >    some unrelated file which happens to have the same name.
> > 
> > 2) seems to be more robust, though -- 3) works until someone installs a
> 
> 2 is not robust. It fails easily as soon as you move or rename files,
> as son as you miss to create one  of  trhe  needed  directories  when
> building out of tree, etc.

It is much more important to be robust against random crap in
/usr/include (something u-boot can't control) than changes in the u-boot
tree itself.

-Scott

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Reply via email to