Subject: Re: make: MACHINE vs. MACHINE_ARCH
To: NetBSD-current Users <current-users@NetBSD.ORG>
From: Curt Sampson <>
List: current-users
Date: 12/22/1996 16:37:21
On Sun, 22 Dec 1996, Curt Sampson wrote:

> Does anyone out there know the original intention behind the use

Oops. I think I've just discovered this. :-) MACHINE is supposed to
be the specific machine (e.g., `sun3'), and MACHINE_ARCH is supposed
to be the `architecture type,' which for some machines is the same
(`i386' and `i386') and for some is different (`sun3' and `m68k').

This makes sense now. However, this brings up a problem with make.
Make will take MACHINE from the environment, but MACHINE_ARCH is
set at compile time. (Actually--and this is sort of a bug on top
of a bug--it can be set with a command line variable, though not
an environment variable, and though this will not be passed on to
any make sessions spawned off of the current one.)

Obviously this isn't going to work for cross-compiling. It seems
to me we should change make so that it can take MACHINE_ARCH, as
well as MACHINE, from the environment, and add a HOST_MACHINE_ARCH
and HOST_MACHINE. HOST_MACHINE can be gotten from uname(3).

Unfortunately, it looks to me as if HOST_MACHINE_ARCH (and the
default for MACHINE_ARCH) would have to be set at compile time,
since I don't see any way to get the host architecture at runtime.
Perhaps this is something that should be added to the kernel sysctl
variables, and sysctl and uname modified to return it? Or perhaps
it's just not important, since if your binary runs you know what
architecture you're running on (or emulating).


Curt Sampson		Info at
Internet Portal Services, Inc.	
Vancouver, BC   (604) 257-9400		De gustibus, aut bene aut nihil.