Thursday, December 13, 2007

MacOS Architectures Compile Flags

It is possible to define what architecture you wish to compile against on MacOS using the following C/C++ flag(s):

-arch ppc (ppc 32bit)
-arch ppc64 (ppc 64bit)
-arch i386 (intel 32bit)
-arch x86_64 (intel 64bit)

Its even possible to combine them to create "Universal Binaries" however the endian-ness of Firebird on ppc v's intel and the way that Firebird is currently built makes this somewhat impossible. Something for the future I think.


Michael Hieke said...

Please consider making at least the Firebird file in the framework universal. I have downloaded your 1.5.5 SuperServer packages, installed them both, and lipoed the files together:

Macintosh:i386u mh$ file /Library/Frameworks/Firebird.framework/Firebird
/Library/Frameworks/Firebird.framework/Firebird: Mach-O universal binary with 2 architectures
/Library/Frameworks/Firebird.framework/Firebird (for architecture i386): Mach-O dynamically linked shared library i386
/Library/Frameworks/Firebird.framework/Firebird (for architecture ppc): Mach-O dynamically linked shared library ppc

Now I can at least make Universal builds against the Firebird framework without having to install different Firebird versions again and again.

But what's really necessary IMHO is an official Universal Framework containing only the client.

Paul Beach said...

Its currently impossible to create a Universal build of Firebird for MacOS. The endianness differences between databases created on ppc or on intel mean that even *if* we had a universal binary, it would only be able to connect to databases created on the build platform. However if we can make the endianess transparent by doing the necessary conversions in the Firebird code itself, then a universal binary might be possible.

Michael Hieke said...

How is using a client library (even with different endianness or machine word width) on the same machine different from using a client library (even with different endianness or machine word width) on another machine, when all data transfer is done via TCP/IP? Why exactly is there no client-only package (4-way fat binary, PPC/i386, 32/64 bit) for Mac OS X?