On Mar 6, 2013, at 10:51, Clemens Lang wrote:
> On Wed, Mar 06, 2013 at 05:19:45PM +0100, Vincent Habchi wrote:
>> Le 6 mars 2013 à 17:07, Gustaf Neumann a écrit :
>>> one can use $::tcl_platform(machine)
>>
>> Viel Dank dafür. It is strictly equivalent to the sysctl (it returns
>> ‘Power Macintosh’ on G4/G5, i386 and x86_64). But it does not need to
>> be catched, so that’s rather fine!
>
> It's actually what os_arch uses internally, but it filters x86_64 and
> translates it to i386:
>
> switch -exact -- $::tcl_platform(machine) {
> x86_64 -
> i686 -
> i586 {
> return i386
> }
> {Power Macintosh} {
> return powerpc
> }
> }
>
> Apparently it might also contain i586, i686 depending on your system.
> You should handle this case, too.
I don't think $::tcl_platform(machine) will help you.
If all you want to know is "am I on an Intel Mac?" then you can use a "platform
i386" block or check if ${os.arch} is "i386". If all you want to know is "am I
on a PowerPC Mac?" then you can use a "platform powerpc" block or check if
${os.arch} is "powerpc". The only values ${os.arch} can have on OS X are "i386"
(on all Intel Macs) or "powerpc" (on all PowerPC Macs).
If you want to know more specifically what type of processor you're on,
"sysctl" is probably what you'll need to use.
$::tcl_platform(machine) seems to correspond to the output of "uname -m", which
tells you about the architecture of the kernel you're running, but that's not
relevant unless the software you're installing is a kernel extension. As an
example, on my MacBookPro3,1 running Snow Leopard, $::tcl_platform(machine) and
"uname -m" both return "i386", because Apple decided that on Snow Leopard this
machine should run the 32-bit kernel. But it's a 64-bit machine and runs 64-bit
software just fine and the MacPorts build_arch is x86_64. If I reboot to Lion,
both return "x86_64" because under Lion and later Apple decided that this
machine was ready to run the 64-bit kernel.
_______________________________________________
macports-dev mailing list
[email protected]
https://lists.macosforge.org/mailman/listinfo/macports-dev