Subject: Re: obj.${MACHINE_ARCH}-${OBJECT_FMT}
To: Jason R Thorpe <thorpej@wasabisystems.com>
From: Simon J. Gerraty <sjg@crufty.net>
List: tech-userlevel
Date: 10/18/2001 15:47:40
>Part of the problem is that $MACHINE and $MACHINE_ARCH currently imply
>both the host *and* the target.  I would like to see this changed.  In
>particular, I would like to see something like this:

>HOST_MACHINE= ${MACHINE}
>HOST_MACHINE_ARCH= ${MACHINE_ARCH}

>TARGET_MACHINE?= ${MACHINE}
>TARGET_MACHINE_ARCH?= ${MACHINE_ARCH}
>TARGET_MACHINE_CPU= what we do with MACHINE_CPU
>TARGET_GNU_ARCH= what we do with MACHINE_GNU_ARCH
>TARGET_GNU_PLATFORM= what we do with MACHINE_GNU_PLATFORM

>...and for the HOST_ and TARGET_ versions of the variable used
>explicitly throughout the build system.  Deprecate the use of
>MACHINE_CPU, MACHINE_GNU_ARCH, and MACHINE_GNU_PLATFORM.

>Then, you can do something clever like:

>if $HOST_MACHINE_ARCH != $TARGET_MACHINE_ARCH
>	objdirsuffix = \
>	    ${HOST_MACHINE_ARCH}-${TARGET_MACHINE_ARCH}-${TARGET_OBJFMT}
>fi

>Or just assign it to the triple all the time and be done with it.

Yep, for trees configured to be built for multiple platforms 
I use a HOST_OBJTOP that works out to have something like

obj-netbsd1-sparc64
obj-freebsd4-i386
obj-sunos5-sun4u

for the tree that holds things that need to run on the build host, and
currently MACHINE_ARCH etc is used to refer to the target system.
Using explicit HOST_* and TARGET_* is a good idea.

>Anyway, this would then allow a builder to simply set TARGET_MACHINE
>and TARGET_MACHINE_ARCH, and be able to cross-build the tree without
>the weird side-effects of overriding MACHINE and MACHINE_ARCH.

Sounds good.

Thanks
--sjg