Subject: Re: tries cross build with host CFLAGS/COPTS?
To: Pavel Cahyna <>
From: Andrew Brown <>
List: current-users
Date: 01/14/2003 12:40:03
>> perhaps something like:
>> __HOST_MACHINE_ARCH!=uname -p
>> CFLAGS=...
>> COPTS=...
>> .endif
>> that should make /etc/mk.conf not set things if the target isn't the
>> same as your host.  you can also conditionally set things in
>That's nice, but things are unfortunately more complicated. For tools
>( -t), at least for the GNU toolchain, CFLAGS are ignored and
>youn need to set HOST_CFLAGS to have the tools optimized for your
>platform. This is probably a feature of GNU configure. E. g. if I 
>compiled for an i386 on an alpha, I've set 
>HOST_CFLAGS=-O2 -mcpu=ev4

i think that's an orthogonal issue.  the original problem as i
understood it was not that flags didn't get passed to the host tools
properly, but that flags got improperly passed to the cross-tools when
they should not have.  by checking that the host and the target are
the "same", you can avoid the latter.

>And, when bulding cross-compilation tools, is MACHINE_ARCH defined to the 
>arch of your host or to the arch for which you are compiling? I think
>the first would make more sense, but I haven't checked it.

ifaict, if you're building cross tools via (ie, you are
running "./ -t -m foo"), then will set MACHINE and
MACHINE_ARCH to the *target*.

|-----< "CODE WARRIOR" >-----|             * "ah!  i see you have the internet (Andrew Brown)                that goes *ping*!"       * "information is power -- share the wealth."