Skip navigation.

Ambassador

The Royal C++ Embassy

SVN::Web on Mac OS X Leopard

, , , , , , ,

We all know the story; nothing works smoothly on Leopard (especially those that are upgraded from Tiger). Apache2 partially breaks during migration from Tiger to Leopard. I didn't extensively use Tiger for development, but Leopard ended up with a binary hell. How? Here's how...

Leopard is capable of running both 64-bit and 32-bit code. However, an 64-bit executable cannot execute 32-bit shared library code and vice versa. Solution is simple; "build 'em both". So you should re-compile (at least) some code for both architectures. Because uname -m reports i386 under Leopard, everything is compiled to 32-bit by default. To compile for multiple platforms, you may need some environment variables, configure arguments, etc.

I have realized that my Apache2 is running 64-bit, but my mod_perl2, libapreq2 are 32-bit. I won't go too deep into details; I simply had to hack libapreq2's Makefile.PL and changed following line:
my $cmd = "./configure $opts";

to:
my $cmd = "./configure $opts --disable-dependency-tracking";

Also, in console:
export ARCHFLAGS=-arch\ i386\ -arch\ x86_64
export CFLAGS=-arch\ i386\ -arch\ x86_64

This will let gcc to accept multiple architecture switches. Otherwise, gcc will complain about -M switches (dependency stuff - I always hated them).
Rebuilding libapreq2 seems to solve the infamous ld problem ("not in correct architecture" warning). I might have done a few more things but they can be environment variables, flags and may be about mod_perl2 - no more hacking.

I don't know Mach-O types of these libraries shipping with Leopard (hey, mod_perl2 isn't shipping with Leopard, isn't it?). I usually think about these important details after I break things. I first broke APR Perl module (I still don't know whether it's libapreq2's or mod_perl2's), then tried to rebuild both libapreq2 and mod_perl2 without checking Mach-O types first. Oh, well!

Simple member thunk for threadsLeopard dual displays = disaster

Write a comment

You must be logged in to write a comment. If you're not a registered member, please sign up.

July 2009
S M T W T F S
June 2009August 2009
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31