Using platforms in 2.8.0

Joshua Root jmr at macports.org
Tue Nov 1 02:56:15 UTC 2022


On 2022-11-1 13:41 , Nils Breunese wrote:
> Joshua Root <jmr at macports.org> wrote:
> 
> According to https://guide.macports.org/#reference.variables ${os.arch} is either “powerpc”, “i386”, or “arm”. Does this mean all Intel machines have ${os.arch} set to ‘i386', regardless of whether they’re 32 or 64 bit machines, or is it possible to distinguish 32 and 64 bit Intel machines based on ${os.arch}? What is the output of `uname -p` on a 64-bit Intel Mac?

That's right, `uname -p` outputs i386 on x86_64 Macs.

> In some of the ports I maintain no building is going on, but the port does need to know whether to install files for 32-bit Intel, 64-bit Intel or 64-bit ARM. Is that possible using platform variants, or does that indeed require checking ${configure.build_arch}?

You need to check ${configure.build_arch}, because that is not 
restricted to a single value on most OS versions, so there is no 1:1 
correspondence between ${os.arch} and the architecture you should be 
installing the port for. A user on an arm machine could ask for x86_64, 
and a user on an x86_64 machine could ask for i386.

- Josh


More information about the macports-dev mailing list