Finding the machine CPU arch

Vincent Habchi vince at macports.org
Wed Mar 6 07:25:47 PST 2013


Le 6 mars 2013 à 16:03, Joshua Root <jmr at macports.org> a écrit :

> You can probably find out with sysctl if you really need to. (It's a Tcl
> proc wrapping sysctlbyname(3), no need to shell out.)

Ok, there is no built-in variable, then.

‘sysctl -n hw.machine’ on Intel gives directly the result (either 'i386' or 'x86_64'). For PPC, I test ‘sysctl -n hw.cpusubtype’ to sort ppc from ppc64. Both work on Tiger and above, so there is no need for a catch block.

Vincent





More information about the macports-dev mailing list