I’m stuck with a whole bunch of problems getting code to compile and co-operate nicely on my new MacBookPro. I’m compiling my own PHP, but it defaults to compiling for the i386 (32bit) architecure, which then fails when Apache2 running in 64bit mode tries to use the 32bit DSO for PHP5. Compiling PHP5 as 64bit then fails linking against the i386 pgsql lib, and so on. I really need everything using the x86_64 architecture. How does this all relate to readline under Leopard?

The problem is the Intel Core2 Duo is a 64bit CPU. Apple supplied apps like Apache2 are compiled as Universal binary AND for 32/64bits. This means there are 4 architectures in the binaries.

When I compile PHP as x86_64 of course it complains that the pgsql libs are also not x86_64, and when I compile postgresql as x86_64, it complains the fink readline library I use is not x86_64. Talk about architectural dependancies! I will need to do another post in depth on the fun had with that whole set of dependancies.

This is how and why I arrived at compiling readline on my Mac 64bit intel under Leopard.

On to the readline problems. I start the compile of readline as x86_64 architecture, and this occurs:

The readline compile scripting is ugly (doesn’t use standard build tools, then fakes it…poorly at times). You need -dynamiclib not -dynamic to compile a shared library on OS X, but this indicates a deeper problem: need to patch support/shobj-conf to know darwin9* as a Darwin/MacOS system if you’re on Leopard (I think readline5.2 only recognizes darwin8*, i.e., Tiger).

Still this is not a fix…. But some further searching and I find a Christopher Rasch on a Watir mailing list who shows how to get around this. Effectivly you need to change the makefile for readlines shlibs to use the -dynamiclib switch when compiling.

Willem Bakker said,

I have a Philips voip321 telephone, formerly used for Skype under Windows. Now I switched to the Mac (OS X 10.7) and I want to use this phone in this environment. Can anybody help me to make this work? Thanks in advance,
Willem (Netherlands)