The problem is that Apple built Apache as a fat binary so it supports four architectures so it will only load modules which are built as fat binaries. You can use the lipo
utility to figure out how something was built:
lorien$ lipo -info /usr/sbin/httpd
Architectures in the fat file: /usr/sbin/httpd are: ppc7400 ppc64 i386 x86_64
Chances are that you will see something like this:
lorien$ lipo -info /usr/libexec/apache2/modules/mod_dav_svn.so
Non-fat file: /usr/libexec/apache2/modules/mod_dav_svn.so is architecture: i386
You can use arch
to force a command to run in one mode or another or the lipo
utility to modify the binary and strip out certain variants. Overall, it is quite a pain to deal with on a case by case basis.
The other option is to compile everything into fat binaries which is what I have been doing lately. With autoconf based things (just about anything with a configure
script), you can usually control much of the process with environment variables. I have a bunch of scripts that wrap the build process to make sure that they get set up correctly. Use the following commands to rebuild svn:
lorien$ cd ~/src/svn-1.6.2
lorien$ cat env-sh
ARCHFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64"
DEVPATH='/Developer/SDKs/MacOSX10.5.sdk'
CPPFLAGS="-isysroot $DEVPATH"
CFLAGS="$ARCHFLAGS $CPPFLAGS"
CXXFLAGS="$CFLAGS"
LDFLAGS="-Wl,-syslibroot,$DEVPATH $ARCHFLAGS"
MACOS_DEPLOYMENT_TARGET=10.5
export CFLAGS CXXFLAGS LDFLAGS MACOS_DEPLOYMENT_TARGET
lorien$ . env-sh
lorien$ ./configure ...
lorien$ make -j2
lorien$ lipo -info subversion/mod_dav_svn/.libs/mod_dav_svn.so
Architectures in the fat file: subversion/mod_dav_svn/.libs/mod_dav_svn.so are: ppc7400 ppc64 i386 x86_64
I keep a copy of the environment in my home directory. Whenever I build something, I copy env-sh
, edit it as needed, source it, then build away. There is a lot more information hidden in the depths of developer.apple.com
like Tech Note 2137 and the Universal Binary Programming Guidelines as well.
Good luck. I know that I am still navigating my way through this morass of fun.