How is MACHINE_ARCH dervived by make?

Sean Bruno sbruno at ignoranthack.me
Wed Nov 26 21:56:51 UTC 2014


On Wed, 2014-11-26 at 13:41 -0800, Garrett Cooper wrote:
> On Nov 26, 2014, at 13:37, Sean Bruno <sbruno at ignoranthack.me> wrote:
> 
> > I have yet to find the magic bit in the build sys that causes ports to
> > go off and think that I'm building for amd64.  Building on a real amd64
> > box inside of an emulated jail via qemu and I still am getting tripped
> > up by something in our system thinking that I want amd64 as the
> > MACHINE_ARCH.
> 
> 	It’s handled in bmake/make. If you need to crossbuild, you’ll probably need to tell make what your MACHINE_ARCH/MACHINE is.
> 	Please refer to the manpages for more details.
> Cheers!
> 

Hrm, man make doesn't bring up the bmake man page (on current).  If it
*did* I would have seen the MACHINE_ARCH comments that allow overrides.
Odd.

> $ grep -rl MACHINE_ARCH contrib/bmake/ usr.bin/make | grep '\.c$'
> contrib/bmake/main.c
> contrib/bmake/arch.c
> usr.bin/make/main.c
> 

Looking now ... it sort of looks like there is some shell script hackery
to do this at build time that depends on uname in machine.sh and os.sh

sean



More information about the freebsd-arch mailing list