SVN::Web on Mac OS X Leopard
Friday, 5. September 2008, 22:12:51
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!









