Re: bakefile fails on Snow Leopard

John Ralls <[email protected]> Tue, 6 Oct 2009 19:29:59 -0700
Newsgroups gmane.comp.sysutils.bakefile.devel
Message-ID <[email protected]>
On Oct 6, 2009, at 2:50 PM, Kevin Ollivier wrote:

>
> For my case (32-bit Python on SnowLeopard), I fixed the problem by  
> setting CC="gcc-4.0" and CXX="g++-4.0" before building Bakefile. 32- 
> bit is the default for that version of the compiler.

To clarify a bit:

If (and only if) you have installed Snow Leopard on a 64-bit-capable  
Mac (core2duo or xeon, but not core duo), the default compiler is  
gcc-4.2.0 and it defaults to arch x86_64.

There are several ways to coerce 32-bit compilation: You can specify  
by any number of ways of coercing 32-bit compilation: As Kevin said,  
gcc-4.0 (also provided by DevTools) defaults to 32-bit compilation.  
Including -arch i386 or -m32 in CFLAGS, CXXFLAGS, OBJCFLAGS, and  
LDFLAGS will coerce any Apple gcc to 32-bit (non-Apple gccs don't  
understand the -arch flag; they also don't understand Frameworks). I  
think that if you specify one of the older SDKs (10.5 or 10.4u) you'll  
get 32bit compilation by default, but I haven't tested that. (Note  
that you can specify -arch i386 -arch x86_64 and get a universal  
binary that can link either way as needed.)

/usr/bin/python is a universal binary of version 2.6.1, containing 32- 
bit ppc, 32-bit i386, and 64-bit x86_64 architectures. On a 64-bit  
machine, x86_64 is the default, but there are several ways to change  
it; man python has the details. There are of course several ways to  
install and use a custom python as well. The important thing to  
remember is that all loadable compiled-and-linked modules must have  
available the selected architecture that python is launched with.

Regards,
John Ralls


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference