Find out if x86_64 is supported

Ryan Schmidt ryandesign at macports.org
Wed Sep 9 12:06:58 PDT 2009


On Sep 9, 2009, at 10:30, Jann Röšder wrote:

> Jann Röšder schrieb:
>>
>
>> for the eiffelstudio port I need a way to find out if the processor
>> supports the 64bit extension. AFAIK the first intel iMacs don't  
>> have a
>> 64bit CPU.
>>
>> What's the best way to do this in a portfile ?

You could use the same method MacPorts itself uses and call "sysctl  
hw.cpu64bit_capable":

http://trac.macports.org/browser/trunk/base/src/macports1.0/macports.tcl?rev=56889#L667

But really, I think you want to use the build_arch variable, which can  
be set by the user in macports.conf and defaults to x86_64 on 64-bit- 
capable hardware in Snow Leopard, or i386 on 32-bit hardware in Snow  
Leopard or i386 or ppc as appropriate on Leopard or earlier.


> I know about the platform x86_64 but it does not seem to be selected  
> on
> my new MacBook.
>
> On the macports command line I get:
> Platform: darwin 10 i386
>
> It should be
> Platform: darwin 10 x86_64
>
> though.

There is no such thing as "platform x86_64" in MacPorts. The only  
processor platforms in MacPorts are "i386" for any Intel machine (be  
it i386 or x86_64) and "powerpc" for any PowerPC machine (be it ppc or  
ppc64).




More information about the macports-dev mailing list