Subject: Re: building -current on FreeBSD fails
To: None <current-users@netbsd.org>
From: Luke Mewburn <lukem@netbsd.org>
List: current-users
Date: 06/06/2003 21:06:43
On Fri, Jun 06, 2003 at 02:23:04PM +0400, Valeriy E. Ushakov wrote:
  | On Thu, Jun 05, 2003 at 18:18:05 +0000, Mark Valentine wrote:
  | 
  | > > The quick workaround is to build with
  | > > 
  | > >     ac_cv_header_sys_endian_h=no
  | > > 
  | > > in the environment to force the build to use netbsd's <sys/endian.h>.
  | > 
  | > I just came across this problem.
  | > 
  | > installboot seems to assume it gets the endian macros via <sys/types.h>
  | > (which includes <machine/endian.h>).
  | > 
  | > It would seem more correct to explicitly include the host's <sys/endian.h>
  | > (not <machine/endian.h>) in tools code which needs these routines.  This
  | > seems to work at least on NetBSD and FreeBSD.
  | 
  | As Luke already reaplied, I can only add that the correct thing to do
  | is to verify if the host's sys/endian.h provides the functions/macros
  | we need.  In practice, it's probably simpler to just always use
  | comapt defs.  E.g. FreeBSD 4.8 doesn't provide htobe64/be64toh.

Let me guess; it provides some of the endian macros though?

I've known for a long time that the way that tools/ "configure" runs
its checks isn't optimal, since it often only tests for one function
in a suite and assuming the rest are or are not available.
This should be changed to explicitly checking for each function; it's
only a little bit slower but far more resistant to false test results.
I intend to clean up a chunk of this "soon".

Luke.