Last Thursday I built SVN from source on my Mac running Leopard 10.5.7 so that I could get svn+ssh capability. (For some reason that functionality wasn’t available using the binary from Collabnet.)
The build was successful and I was able to use SVN afterwords, but apache stopped launching.
When I tracked down the error, this is what I’m getting:
Syntax error on line 117 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec
/apache2/mod_dav_svn.so into server: dlopen(/usr/libexec/apache2/mod_dav_svn.so, 10): no
suitable image found. Did find:\n\t/usr/libexec/apache2/mod_dav_svn.so: mach-o, but
wrong architecture
I suspect that doing the build mucked something up but I’m not sure where to go from here.
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
lipoutility to figure out how something was built:Chances are that you will see something like this:
You can use
archto force a command to run in one mode or another or thelipoutility 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
configurescript), 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: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 ofdeveloper.apple.comlike 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.